mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Got rid of ES7 notation and built library
This commit is contained in:

committed by
Zeno Rocha

parent
8dc4e2e132
commit
e5a6797c82
23
dist/clipboard.js
vendored
23
dist/clipboard.js
vendored
@ -477,11 +477,21 @@ var Clipboard = (function (_Emitter) {
|
|||||||
_classCallCheck(this, Clipboard);
|
_classCallCheck(this, Clipboard);
|
||||||
|
|
||||||
_Emitter.call(this);
|
_Emitter.call(this);
|
||||||
|
this.initialize = this.initialize.bind(this); // pre-bind for consistent reference on remove
|
||||||
|
|
||||||
this.resolveOptions(options);
|
this.resolveOptions(options);
|
||||||
this.delegateClick(selector);
|
this.delegateClick(selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} selector
|
||||||
|
* @param {Object} options
|
||||||
|
*/
|
||||||
|
|
||||||
|
Clipboard.prototype.destroy = function destroy() {
|
||||||
|
this.undelegateClick();
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines if attributes would be resolved using internal setter functions
|
* Defines if attributes would be resolved using internal setter functions
|
||||||
* or custom functions that were passed in the constructor.
|
* or custom functions that were passed in the constructor.
|
||||||
@ -502,11 +512,16 @@ var Clipboard = (function (_Emitter) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Clipboard.prototype.delegateClick = function delegateClick(selector) {
|
Clipboard.prototype.delegateClick = function delegateClick(selector) {
|
||||||
var _this = this;
|
_delegateEvents2['default'].bind(document.body, selector, 'click', this.initialize);
|
||||||
|
};
|
||||||
|
|
||||||
_delegateEvents2['default'].bind(document.body, selector, 'click', function (e) {
|
/**
|
||||||
return _this.initialize(e);
|
* Undelegates a click event on the passed selector.
|
||||||
});
|
* @param {String} selector
|
||||||
|
*/
|
||||||
|
|
||||||
|
Clipboard.prototype.undelegateClick = function undelegateClick() {
|
||||||
|
_delegateEvents2['default'].unbind(document.body, 'click', this.initialize);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
2
dist/clipboard.min.js
vendored
2
dist/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user