summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/single_file_diff.js
diff options
context:
space:
mode:
authorBryce Johnson <bryce@gitlab.com>2017-06-12 14:43:21 -0400
committerBryce Johnson <bryce@gitlab.com>2017-06-29 12:50:45 -0400
commit81e9c2842574b10d694a8e29665c77fde7fd6ae5 (patch)
treec7fad475df58553505885b9e2de9b9543bc6d3f3 /app/assets/javascripts/single_file_diff.js
parent066a6c8ba8900f0883ee788d901d300850b1ae61 (diff)
downloadgitlab-ce-81e9c2842574b10d694a8e29665c77fde7fd6ae5.tar.gz
Render add-diff-note button with server.
This commit moves the rendering of the button back to the server, and shows/hides it using opacity rather than display. It also removes the transform applied to the button on hover (scale). Previously, both of these factors automatically triggered a reflow, which creates a performance bottleneck on pages with larger DOM size. MR: !12103
Diffstat (limited to 'app/assets/javascripts/single_file_diff.js')
-rw-r--r--app/assets/javascripts/single_file_diff.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/assets/javascripts/single_file_diff.js b/app/assets/javascripts/single_file_diff.js
index c44892dae3d..9316a2af0b7 100644
--- a/app/assets/javascripts/single_file_diff.js
+++ b/app/assets/javascripts/single_file_diff.js
@@ -1,5 +1,7 @@
/* eslint-disable func-names, prefer-arrow-callback, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, one-var, one-var-declaration-per-line, consistent-return, no-param-reassign, max-len */
+import FilesCommentButton from './files_comment_button';
+
(function() {
window.SingleFileDiff = (function() {
var COLLAPSED_HTML, ERROR_HTML, LOADING_HTML, WRAPPER;
@@ -78,6 +80,8 @@
gl.diffNotesCompileComponents();
}
+ FilesCommentButton.init($(_this.file));
+
if (cb) cb();
};
})(this));