summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-01-18 13:25:10 -0600
committerMike Greiling <mike@pixelcog.com>2017-01-18 13:25:10 -0600
commit7c29f03e23c0a87b1dc9dacda173f40de17378eb (patch)
tree9d05e527985dd9e2eecb66c9d0de1a5d1927bd27
parent1cc6d206b5d4cf09bb502a254703f3a2de2dbeb7 (diff)
downloadgitlab-ce-7c29f03e23c0a87b1dc9dacda173f40de17378eb.tar.gz
-rw-r--r--app/assets/javascripts/diff.js.es611
1 files changed, 7 insertions, 4 deletions
diff --git a/app/assets/javascripts/diff.js.es6 b/app/assets/javascripts/diff.js.es6
index 5e1a4c948aa..328d383a060 100644
--- a/app/assets/javascripts/diff.js.es6
+++ b/app/assets/javascripts/diff.js.es6
@@ -2,6 +2,7 @@
(() => {
const UNFOLD_COUNT = 20;
+ let isBound = false;
class Diff {
constructor() {
@@ -15,10 +16,12 @@
$('.content-wrapper .container-fluid').removeClass('container-limited');
}
- $(document)
- .off('click', '.js-unfold, .diff-line-num a')
- .on('click', '.js-unfold', this.handleClickUnfold.bind(this))
- .on('click', '.diff-line-num a', this.handleClickLineNum.bind(this));
+ if (!isBound) {
+ $(document)
+ .on('click', '.js-unfold', this.handleClickUnfold.bind(this))
+ .on('click', '.diff-line-num a', this.handleClickLineNum.bind(this));
+ isBound = true;
+ }
this.openAnchoredDiff();
}