Commit 8bdd88a4 authored by Phil Hughes's avatar Phil Hughes

Checks if DiffNotesApp is defined

parent ee62a2fd
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
return function(data) { return function(data) {
$('#diffs').html(data.html); $('#diffs').html(data.html);
if (DiffNotesApp) { if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents(); DiffNotesApp.compileComponents();
} }
......
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
discussionContainer.append(note_html); discussionContainer.append(note_html);
} }
if (DiffNotesApp) { if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents(); DiffNotesApp.compileComponents();
} }
...@@ -429,7 +429,7 @@ ...@@ -429,7 +429,7 @@
$note_li.replaceWith($html); $note_li.replaceWith($html);
if (DiffNotesApp) { if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents(); DiffNotesApp.compileComponents();
} }
}; };
...@@ -593,7 +593,7 @@ ...@@ -593,7 +593,7 @@
if (canResolve === 'false' || !form.closest('.notes_content').find('.note:not(.system-note)').length) { if (canResolve === 'false' || !form.closest('.notes_content').find('.note:not(.system-note)').length) {
form.find('comment-and-resolve-btn').remove(); form.find('comment-and-resolve-btn').remove();
} else if (DiffNotesApp) { } else if (typeof DiffNotesApp !== 'undefined') {
var $commentBtn = form.find('comment-and-resolve-btn'); var $commentBtn = form.find('comment-and-resolve-btn');
$commentBtn $commentBtn
.attr(':discussion-id', "'" + dataHolder.data('discussionId') + "'"); .attr(':discussion-id', "'" + dataHolder.data('discussionId') + "'");
......
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
if (!this.isOpen && !this.hasError) { if (!this.isOpen && !this.hasError) {
this.content.hide(); this.content.hide();
this.collapsedContent.show(); this.collapsedContent.show();
if (DiffNotesApp) { if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents(); DiffNotesApp.compileComponents();
} }
} else if (this.content) { } else if (this.content) {
this.collapsedContent.hide(); this.collapsedContent.hide();
this.content.show(); this.content.show();
if (DiffNotesApp) { if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents(); DiffNotesApp.compileComponents();
} }
} else { } else {
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
if (data.html) { if (data.html) {
_this.content = $(data.html); _this.content = $(data.html);
_this.content.syntaxHighlight(); _this.content.syntaxHighlight();
if (DiffNotesApp) { if (typeof DiffNotesApp !== 'undefined') {
DiffNotesApp.compileComponents(); DiffNotesApp.compileComponents();
} }
} else { } else {
......
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