diff options
author | Phil Hughes <me@iamphill.com> | 2016-08-01 13:03:16 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-08-01 13:03:16 +0100 |
commit | 8bdd88a41b3ac402ce1b78b092545dc9c927fba6 (patch) | |
tree | 885058c151f6bd826995277fb770923cf3eea46b /app/assets | |
parent | ee62a2fd5ac44d67fd60e75989f03ea653aa2c54 (diff) | |
download | gitlab-ce-8bdd88a41b3ac402ce1b78b092545dc9c927fba6.tar.gz |
Checks if DiffNotesApp is defined
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/notes.js | 6 | ||||
-rw-r--r-- | app/assets/javascripts/single_file_diff.js | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index ff1416af31b..cfd10922bd0 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -120,7 +120,7 @@ return function(data) { $('#diffs').html(data.html); - if (DiffNotesApp) { + if (typeof DiffNotesApp !== 'undefined') { DiffNotesApp.compileComponents(); } diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index ab169d04804..fd5163bdd5b 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -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') + "'"); diff --git a/app/assets/javascripts/single_file_diff.js b/app/assets/javascripts/single_file_diff.js index 9d181586b1d..b9adc5f3728 100644 --- a/app/assets/javascripts/single_file_diff.js +++ b/app/assets/javascripts/single_file_diff.js @@ -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 { |