add loading class to preview element and check it to prevent multiple ajax requests
This commit is contained in:
parent
2b6f6e7b65
commit
948fd40ccd
1 changed files with 3 additions and 3 deletions
|
@ -23,10 +23,10 @@
|
|||
if (mdText.trim().length === 0) {
|
||||
preview.text('Nothing to preview.');
|
||||
this.hideReferencedUsers($form);
|
||||
} else {
|
||||
preview.text('Loading...');
|
||||
} else if (!preview.hasClass('md-preview-loading')) {
|
||||
preview.addClass('md-preview-loading').text('Loading...');
|
||||
this.fetchMarkdownPreview(mdText, (function(response) {
|
||||
preview.html(response.body);
|
||||
preview.removeClass('md-preview-loading').html(response.body);
|
||||
preview.renderGFM();
|
||||
this.renderReferencedUsers(response.references.users, $form);
|
||||
}).bind(this));
|
||||
|
|
Loading…
Reference in a new issue