Checks if DiffNotesApp is defined

This commit is contained in:
Phil Hughes 2016-08-01 13:03:16 +01:00
parent ee62a2fd5a
commit 8bdd88a41b
3 changed files with 7 additions and 7 deletions

View File

@ -120,7 +120,7 @@
return function(data) {
$('#diffs').html(data.html);
if (DiffNotesApp) {
if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents();
}

View File

@ -300,7 +300,7 @@
discussionContainer.append(note_html);
}
if (DiffNotesApp) {
if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents();
}
@ -429,7 +429,7 @@
$note_li.replaceWith($html);
if (DiffNotesApp) {
if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents();
}
};
@ -593,7 +593,7 @@
if (canResolve === 'false' || !form.closest('.notes_content').find('.note:not(.system-note)').length) {
form.find('comment-and-resolve-btn').remove();
} else if (DiffNotesApp) {
} else if (typeof DiffNotesApp !== 'undefined') {
var $commentBtn = form.find('comment-and-resolve-btn');
$commentBtn
.attr(':discussion-id', "'" + dataHolder.data('discussionId') + "'");

View File

@ -36,13 +36,13 @@
if (!this.isOpen && !this.hasError) {
this.content.hide();
this.collapsedContent.show();
if (DiffNotesApp) {
if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents();
}
} else if (this.content) {
this.collapsedContent.hide();
this.content.show();
if (DiffNotesApp) {
if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents();
}
} else {
@ -59,7 +59,7 @@
if (data.html) {
_this.content = $(data.html);
_this.content.syntaxHighlight();
if (DiffNotesApp) {
if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents();
}
} else {