scratch

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 124  →  ?path2? @ 125
/bower_components/clipboard/dist/clipboard.js
@@ -1,5 +1,5 @@
/*!
* clipboard.js v1.6.1
* clipboard.js v1.7.1
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
@@ -29,7 +29,10 @@
*/
function closest (element, selector) {
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
if (element.matches(selector)) return element;
if (typeof element.matches === 'function' &&
element.matches(selector)) {
return element;
}
element = element.parentNode;
}
}
@@ -420,6 +423,7 @@
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 
this.action = options.action;
this.container = options.container;
this.emitter = options.emitter;
this.target = options.target;
this.text = options.text;
@@ -448,7 +452,7 @@
this.fakeHandlerCallback = function () {
return _this.removeFake();
};
this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;
 
this.fakeElem = document.createElement('textarea');
// Prevent zooming on iOS
@@ -467,7 +471,7 @@
this.fakeElem.setAttribute('readonly', '');
this.fakeElem.value = this.text;
 
document.body.appendChild(this.fakeElem);
this.container.appendChild(this.fakeElem);
 
this.selectedText = (0, _select2.default)(this.fakeElem);
this.copyText();
@@ -476,13 +480,13 @@
key: 'removeFake',
value: function removeFake() {
if (this.fakeHandler) {
document.body.removeEventListener('click', this.fakeHandlerCallback);
this.container.removeEventListener('click', this.fakeHandlerCallback);
this.fakeHandler = null;
this.fakeHandlerCallback = null;
}
 
if (this.fakeElem) {
document.body.removeChild(this.fakeElem);
this.container.removeChild(this.fakeElem);
this.fakeElem = null;
}
}
@@ -518,8 +522,8 @@
}, {
key: 'clearSelection',
value: function clearSelection() {
if (this.target) {
this.target.blur();
if (this.trigger) {
this.trigger.focus();
}
 
window.getSelection().removeAllRanges();
@@ -601,6 +605,12 @@
};
}
 
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
 
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
@@ -681,6 +691,7 @@
this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
this.text = typeof options.text === 'function' ? options.text : this.defaultText;
this.container = _typeof(options.container) === 'object' ? options.container : document.body;
}
}, {
key: 'listenClick',
@@ -704,6 +715,7 @@
action: this.action(trigger),
target: this.target(trigger),
text: this.text(trigger),
container: this.container,
trigger: trigger,
emitter: this
});