summaryrefslogtreecommitdiff
path: root/vendor/assets
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-07-26 10:46:44 +0100
committerPhil Hughes <me@iamphill.com>2016-08-17 17:12:47 +0100
commit61fa7b756e2bbb96206effeb78f85de0de3d663b (patch)
tree8d517eee0ecad4597e8c37d95e7a62ff1a0fad90 /vendor/assets
parentc369ea6c9b09a8d552f1917859cee33401a3e797 (diff)
downloadgitlab-ce-61fa7b756e2bbb96206effeb78f85de0de3d663b.tar.gz
Removes boards correctly
Diffstat (limited to 'vendor/assets')
-rw-r--r--vendor/assets/javascripts/clipboard.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/vendor/assets/javascripts/clipboard.js b/vendor/assets/javascripts/clipboard.js
index 1b1f4f0bd63..39d7d2306f8 100644
--- a/vendor/assets/javascripts/clipboard.js
+++ b/vendor/assets/javascripts/clipboard.js
@@ -154,12 +154,12 @@ function E () {
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
-
+
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx
});
-
+
return this;
},
@@ -169,7 +169,7 @@ E.prototype = {
self.off(name, fn);
callback.apply(ctx, arguments);
};
-
+
return this.on(name, fn, ctx);
},
@@ -178,11 +178,11 @@ E.prototype = {
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
-
+
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
-
+
return this;
},
@@ -190,21 +190,21 @@ E.prototype = {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
-
+
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback) liveEvents.push(evts[i]);
}
}
-
+
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
- (liveEvents.length)
+ (liveEvents.length)
? e[name] = liveEvents
: delete e[name];
-
+
return this;
}
};
@@ -618,4 +618,4 @@ exports['default'] = Clipboard;
module.exports = exports['default'];
},{"./clipboard-action":6,"delegate-events":1,"tiny-emitter":5}]},{},[7])(7)
-}); \ No newline at end of file
+});