Commit de427dc5 authored by Mike Greiling's avatar Mike Greiling

use $ sign to make it clear when dealing with jQuery object

parent 4f8087d6
...@@ -16,19 +16,19 @@ ...@@ -16,19 +16,19 @@
MarkdownPreview.prototype.ajaxCache = {}; MarkdownPreview.prototype.ajaxCache = {};
MarkdownPreview.prototype.showPreview = function(form) { MarkdownPreview.prototype.showPreview = function($form) {
var mdText, preview; var mdText, preview;
preview = form.find('.js-md-preview'); preview = $form.find('.js-md-preview');
mdText = form.find('textarea.markdown-area').val(); mdText = $form.find('textarea.markdown-area').val();
if (mdText.trim().length === 0) { if (mdText.trim().length === 0) {
preview.text('Nothing to preview.'); preview.text('Nothing to preview.');
this.hideReferencedUsers(form); this.hideReferencedUsers($form);
} else { } else {
preview.text('Loading...'); preview.text('Loading...');
this.renderMarkdown(mdText, (function(response) { this.renderMarkdown(mdText, (function(response) {
preview.html(response.body); preview.html(response.body);
preview.renderGFM(); preview.renderGFM();
this.renderReferencedUsers(response.references.users, form); this.renderReferencedUsers(response.references.users, $form);
}).bind(this)); }).bind(this));
} }
}; };
...@@ -58,13 +58,13 @@ ...@@ -58,13 +58,13 @@
}); });
}; };
MarkdownPreview.prototype.hideReferencedUsers = function(form) { MarkdownPreview.prototype.hideReferencedUsers = function($form) {
form.find('.referenced-users').hide(); $form.find('.referenced-users').hide();
}; };
MarkdownPreview.prototype.renderReferencedUsers = function(users, form) { MarkdownPreview.prototype.renderReferencedUsers = function(users, $form) {
var referencedUsers; var referencedUsers;
referencedUsers = form.find('.referenced-users'); referencedUsers = $form.find('.referenced-users');
if (referencedUsers.length) { if (referencedUsers.length) {
if (users.length >= this.referenceThreshold) { if (users.length >= this.referenceThreshold) {
referencedUsers.show(); referencedUsers.show();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment