BigW Consortium Gitlab

Commit de427dc5 by Mike Greiling

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

parent 4f8087d6
......@@ -16,19 +16,19 @@
MarkdownPreview.prototype.ajaxCache = {};
MarkdownPreview.prototype.showPreview = function(form) {
MarkdownPreview.prototype.showPreview = function($form) {
var mdText, preview;
preview = form.find('.js-md-preview');
mdText = form.find('textarea.markdown-area').val();
preview = $form.find('.js-md-preview');
mdText = $form.find('textarea.markdown-area').val();
if (mdText.trim().length === 0) {
preview.text('Nothing to preview.');
this.hideReferencedUsers(form);
this.hideReferencedUsers($form);
} else {
preview.text('Loading...');
this.renderMarkdown(mdText, (function(response) {
preview.html(response.body);
preview.renderGFM();
this.renderReferencedUsers(response.references.users, form);
this.renderReferencedUsers(response.references.users, $form);
}).bind(this));
}
};
......@@ -58,13 +58,13 @@
});
};
MarkdownPreview.prototype.hideReferencedUsers = function(form) {
form.find('.referenced-users').hide();
MarkdownPreview.prototype.hideReferencedUsers = function($form) {
$form.find('.referenced-users').hide();
};
MarkdownPreview.prototype.renderReferencedUsers = function(users, form) {
MarkdownPreview.prototype.renderReferencedUsers = function(users, $form) {
var referencedUsers;
referencedUsers = form.find('.referenced-users');
referencedUsers = $form.find('.referenced-users');
if (referencedUsers.length) {
if (users.length >= this.referenceThreshold) {
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