summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/files_comment_button.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/files_comment_button.js b/app/assets/javascripts/files_comment_button.js
index 59d6508fc02..588fe960e57 100644
--- a/app/assets/javascripts/files_comment_button.js
+++ b/app/assets/javascripts/files_comment_button.js
@@ -30,7 +30,10 @@ window.FilesCommentButton = (function() {
this.render = bind(this.render, this);
this.hideButton = bind(this.hideButton, this);
this.isParallelView = notes.isParallelView();
- filesContainerElement.on('mouseover', LINE_COLUMN_CLASSES, this.render)
+
+ const debounce = _.debounce(this.render, 100);
+
+ filesContainerElement.on('mouseover', LINE_COLUMN_CLASSES, debounce)
.on('mouseleave', LINE_COLUMN_CLASSES, this.hideButton);
}