1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | (function webpackUniversalModuleDefinition(root, factory) {
|
8 | if(typeof exports === 'object' && typeof module === 'object')
|
9 | module.exports = factory();
|
10 | else if(typeof define === 'function' && define.amd)
|
11 | define([], factory);
|
12 | else if(typeof exports === 'object')
|
13 | exports["ClipboardJS"] = factory();
|
14 | else
|
15 | root["ClipboardJS"] = factory();
|
16 | })(this, function() {
|
17 | return (function() {
|
18 | var __webpack_modules__ = ({
|
19 |
|
20 | 686:
|
21 | (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
22 |
|
23 | "use strict";
|
24 |
|
25 |
|
26 | __webpack_require__.d(__webpack_exports__, {
|
27 | "default": function() { return clipboard; }
|
28 | });
|
29 |
|
30 |
|
31 | var tiny_emitter = __webpack_require__(279);
|
32 | var tiny_emitter_default = __webpack_require__.n(tiny_emitter);
|
33 |
|
34 | var listen = __webpack_require__(370);
|
35 | var listen_default = __webpack_require__.n(listen);
|
36 |
|
37 | var src_select = __webpack_require__(817);
|
38 | var select_default = __webpack_require__.n(src_select);
|
39 | ;
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | function command(type) {
|
46 | try {
|
47 | return document.execCommand(type);
|
48 | } catch (err) {
|
49 | return false;
|
50 | }
|
51 | }
|
52 | ;
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | var ClipboardActionCut = function ClipboardActionCut(target) {
|
62 | var selectedText = select_default()(target);
|
63 | command('cut');
|
64 | return selectedText;
|
65 | };
|
66 |
|
67 | var actions_cut = (ClipboardActionCut);
|
68 | ;
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | function createFakeElement(value) {
|
75 | var isRTL = document.documentElement.getAttribute('dir') === 'rtl';
|
76 | var fakeElement = document.createElement('textarea');
|
77 |
|
78 | fakeElement.style.fontSize = '12pt';
|
79 |
|
80 | fakeElement.style.border = '0';
|
81 | fakeElement.style.padding = '0';
|
82 | fakeElement.style.margin = '0';
|
83 |
|
84 | fakeElement.style.position = 'absolute';
|
85 | fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px';
|
86 |
|
87 | var yPosition = window.pageYOffset || document.documentElement.scrollTop;
|
88 | fakeElement.style.top = "".concat(yPosition, "px");
|
89 | fakeElement.setAttribute('readonly', '');
|
90 | fakeElement.value = value;
|
91 | return fakeElement;
|
92 | }
|
93 | ;
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 | var ClipboardActionCopy = function ClipboardActionCopy(target) {
|
105 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
106 | container: document.body
|
107 | };
|
108 | var selectedText = '';
|
109 |
|
110 | if (typeof target === 'string') {
|
111 | var fakeElement = createFakeElement(target);
|
112 | options.container.appendChild(fakeElement);
|
113 | selectedText = select_default()(fakeElement);
|
114 | command('copy');
|
115 | fakeElement.remove();
|
116 | } else {
|
117 | selectedText = select_default()(target);
|
118 | command('copy');
|
119 | }
|
120 |
|
121 | return selectedText;
|
122 | };
|
123 |
|
124 | var actions_copy = (ClipboardActionCopy);
|
125 | ;
|
126 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 | var ClipboardActionDefault = function ClipboardActionDefault() {
|
137 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
138 |
|
139 | var _options$action = options.action,
|
140 | action = _options$action === void 0 ? 'copy' : _options$action,
|
141 | container = options.container,
|
142 | target = options.target,
|
143 | text = options.text;
|
144 |
|
145 | if (action !== 'copy' && action !== 'cut') {
|
146 | throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
147 | }
|
148 |
|
149 |
|
150 | if (target !== undefined) {
|
151 | if (target && _typeof(target) === 'object' && target.nodeType === 1) {
|
152 | if (action === 'copy' && target.hasAttribute('disabled')) {
|
153 | throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
154 | }
|
155 |
|
156 | if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
|
157 | throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
|
158 | }
|
159 | } else {
|
160 | throw new Error('Invalid "target" value, use a valid Element');
|
161 | }
|
162 | }
|
163 |
|
164 |
|
165 | if (text) {
|
166 | return actions_copy(text, {
|
167 | container: container
|
168 | });
|
169 | }
|
170 |
|
171 |
|
172 | if (target) {
|
173 | return action === 'cut' ? actions_cut(target) : actions_copy(target, {
|
174 | container: container
|
175 | });
|
176 | }
|
177 | };
|
178 |
|
179 | var actions_default = (ClipboardActionDefault);
|
180 | ;
|
181 | function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); }
|
182 |
|
183 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
184 |
|
185 | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
186 |
|
187 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
188 |
|
189 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
190 |
|
191 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
192 |
|
193 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
194 |
|
195 | function _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
196 |
|
197 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
198 |
|
199 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
200 |
|
201 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 | function getAttributeValue(suffix, element) {
|
215 | var attribute = "data-clipboard-".concat(suffix);
|
216 |
|
217 | if (!element.hasAttribute(attribute)) {
|
218 | return;
|
219 | }
|
220 |
|
221 | return element.getAttribute(attribute);
|
222 | }
|
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 |
|
229 | var Clipboard = function (_Emitter) {
|
230 | _inherits(Clipboard, _Emitter);
|
231 |
|
232 | var _super = _createSuper(Clipboard);
|
233 |
|
234 | |
235 |
|
236 |
|
237 |
|
238 | function Clipboard(trigger, options) {
|
239 | var _this;
|
240 |
|
241 | _classCallCheck(this, Clipboard);
|
242 |
|
243 | _this = _super.call(this);
|
244 |
|
245 | _this.resolveOptions(options);
|
246 |
|
247 | _this.listenClick(trigger);
|
248 |
|
249 | return _this;
|
250 | }
|
251 | |
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 | _createClass(Clipboard, [{
|
259 | key: "resolveOptions",
|
260 | value: function resolveOptions() {
|
261 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
262 | this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
|
263 | this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
|
264 | this.text = typeof options.text === 'function' ? options.text : this.defaultText;
|
265 | this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;
|
266 | }
|
267 | |
268 |
|
269 |
|
270 |
|
271 |
|
272 | }, {
|
273 | key: "listenClick",
|
274 | value: function listenClick(trigger) {
|
275 | var _this2 = this;
|
276 |
|
277 | this.listener = listen_default()(trigger, 'click', function (e) {
|
278 | return _this2.onClick(e);
|
279 | });
|
280 | }
|
281 | |
282 |
|
283 |
|
284 |
|
285 |
|
286 | }, {
|
287 | key: "onClick",
|
288 | value: function onClick(e) {
|
289 | var trigger = e.delegateTarget || e.currentTarget;
|
290 | var selectedText = actions_default({
|
291 | action: this.action(trigger),
|
292 | container: this.container,
|
293 | target: this.target(trigger),
|
294 | text: this.text(trigger)
|
295 | });
|
296 |
|
297 | this.emit(selectedText ? 'success' : 'error', {
|
298 | action: this.action,
|
299 | text: selectedText,
|
300 | trigger: trigger,
|
301 | clearSelection: function clearSelection() {
|
302 | if (trigger) {
|
303 | trigger.focus();
|
304 | }
|
305 |
|
306 | document.activeElement.blur();
|
307 | window.getSelection().removeAllRanges();
|
308 | }
|
309 | });
|
310 | }
|
311 | |
312 |
|
313 |
|
314 |
|
315 |
|
316 | }, {
|
317 | key: "defaultAction",
|
318 | value: function defaultAction(trigger) {
|
319 | return getAttributeValue('action', trigger);
|
320 | }
|
321 | |
322 |
|
323 |
|
324 |
|
325 |
|
326 | }, {
|
327 | key: "defaultTarget",
|
328 | value: function defaultTarget(trigger) {
|
329 | var selector = getAttributeValue('target', trigger);
|
330 |
|
331 | if (selector) {
|
332 | return document.querySelector(selector);
|
333 | }
|
334 | }
|
335 | |
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 | }, {
|
343 | key: "defaultText",
|
344 |
|
345 | |
346 |
|
347 |
|
348 |
|
349 | value: function defaultText(trigger) {
|
350 | return getAttributeValue('text', trigger);
|
351 | }
|
352 | |
353 |
|
354 |
|
355 |
|
356 | }, {
|
357 | key: "destroy",
|
358 | value: function destroy() {
|
359 | this.listener.destroy();
|
360 | }
|
361 | }], [{
|
362 | key: "copy",
|
363 | value: function copy(target) {
|
364 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
365 | container: document.body
|
366 | };
|
367 | return actions_copy(target, options);
|
368 | }
|
369 | |
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 | }, {
|
376 | key: "cut",
|
377 | value: function cut(target) {
|
378 | return actions_cut(target);
|
379 | }
|
380 | |
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 | }, {
|
387 | key: "isSupported",
|
388 | value: function isSupported() {
|
389 | var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
|
390 | var actions = typeof action === 'string' ? [action] : action;
|
391 | var support = !!document.queryCommandSupported;
|
392 | actions.forEach(function (action) {
|
393 | support = support && !!document.queryCommandSupported(action);
|
394 | });
|
395 | return support;
|
396 | }
|
397 | }]);
|
398 |
|
399 | return Clipboard;
|
400 | }((tiny_emitter_default()));
|
401 |
|
402 | var clipboard = (Clipboard);
|
403 |
|
404 | }),
|
405 |
|
406 | 828:
|
407 | (function(module) {
|
408 |
|
409 | var DOCUMENT_NODE_TYPE = 9;
|
410 |
|
411 |
|
412 |
|
413 |
|
414 | if (typeof Element !== 'undefined' && !Element.prototype.matches) {
|
415 | var proto = Element.prototype;
|
416 |
|
417 | proto.matches = proto.matchesSelector ||
|
418 | proto.mozMatchesSelector ||
|
419 | proto.msMatchesSelector ||
|
420 | proto.oMatchesSelector ||
|
421 | proto.webkitMatchesSelector;
|
422 | }
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 | function closest (element, selector) {
|
432 | while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
|
433 | if (typeof element.matches === 'function' &&
|
434 | element.matches(selector)) {
|
435 | return element;
|
436 | }
|
437 | element = element.parentNode;
|
438 | }
|
439 | }
|
440 |
|
441 | module.exports = closest;
|
442 |
|
443 |
|
444 | }),
|
445 |
|
446 | 438:
|
447 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
448 |
|
449 | var closest = __webpack_require__(828);
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 | function _delegate(element, selector, type, callback, useCapture) {
|
462 | var listenerFn = listener.apply(this, arguments);
|
463 |
|
464 | element.addEventListener(type, listenerFn, useCapture);
|
465 |
|
466 | return {
|
467 | destroy: function() {
|
468 | element.removeEventListener(type, listenerFn, useCapture);
|
469 | }
|
470 | }
|
471 | }
|
472 |
|
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 | function delegate(elements, selector, type, callback, useCapture) {
|
484 |
|
485 | if (typeof elements.addEventListener === 'function') {
|
486 | return _delegate.apply(null, arguments);
|
487 | }
|
488 |
|
489 |
|
490 | if (typeof type === 'function') {
|
491 |
|
492 |
|
493 | return _delegate.bind(null, document).apply(null, arguments);
|
494 | }
|
495 |
|
496 |
|
497 | if (typeof elements === 'string') {
|
498 | elements = document.querySelectorAll(elements);
|
499 | }
|
500 |
|
501 |
|
502 | return Array.prototype.map.call(elements, function (element) {
|
503 | return _delegate(element, selector, type, callback, useCapture);
|
504 | });
|
505 | }
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 | function listener(element, selector, type, callback) {
|
517 | return function(e) {
|
518 | e.delegateTarget = closest(e.target, selector);
|
519 |
|
520 | if (e.delegateTarget) {
|
521 | callback.call(element, e);
|
522 | }
|
523 | }
|
524 | }
|
525 |
|
526 | module.exports = delegate;
|
527 |
|
528 |
|
529 | }),
|
530 |
|
531 | 879:
|
532 | (function(__unused_webpack_module, exports) {
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 | exports.node = function(value) {
|
541 | return value !== undefined
|
542 | && value instanceof HTMLElement
|
543 | && value.nodeType === 1;
|
544 | };
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 | exports.nodeList = function(value) {
|
553 | var type = Object.prototype.toString.call(value);
|
554 |
|
555 | return value !== undefined
|
556 | && (type === '[object NodeList]' || type === '[object HTMLCollection]')
|
557 | && ('length' in value)
|
558 | && (value.length === 0 || exports.node(value[0]));
|
559 | };
|
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 | exports.string = function(value) {
|
568 | return typeof value === 'string'
|
569 | || value instanceof String;
|
570 | };
|
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 | exports.fn = function(value) {
|
579 | var type = Object.prototype.toString.call(value);
|
580 |
|
581 | return type === '[object Function]';
|
582 | };
|
583 |
|
584 |
|
585 | }),
|
586 |
|
587 | 370:
|
588 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
589 |
|
590 | var is = __webpack_require__(879);
|
591 | var delegate = __webpack_require__(438);
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 | function listen(target, type, callback) {
|
603 | if (!target && !type && !callback) {
|
604 | throw new Error('Missing required arguments');
|
605 | }
|
606 |
|
607 | if (!is.string(type)) {
|
608 | throw new TypeError('Second argument must be a String');
|
609 | }
|
610 |
|
611 | if (!is.fn(callback)) {
|
612 | throw new TypeError('Third argument must be a Function');
|
613 | }
|
614 |
|
615 | if (is.node(target)) {
|
616 | return listenNode(target, type, callback);
|
617 | }
|
618 | else if (is.nodeList(target)) {
|
619 | return listenNodeList(target, type, callback);
|
620 | }
|
621 | else if (is.string(target)) {
|
622 | return listenSelector(target, type, callback);
|
623 | }
|
624 | else {
|
625 | throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
|
626 | }
|
627 | }
|
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 | function listenNode(node, type, callback) {
|
639 | node.addEventListener(type, callback);
|
640 |
|
641 | return {
|
642 | destroy: function() {
|
643 | node.removeEventListener(type, callback);
|
644 | }
|
645 | }
|
646 | }
|
647 |
|
648 |
|
649 |
|
650 |
|
651 |
|
652 |
|
653 |
|
654 |
|
655 |
|
656 |
|
657 | function listenNodeList(nodeList, type, callback) {
|
658 | Array.prototype.forEach.call(nodeList, function(node) {
|
659 | node.addEventListener(type, callback);
|
660 | });
|
661 |
|
662 | return {
|
663 | destroy: function() {
|
664 | Array.prototype.forEach.call(nodeList, function(node) {
|
665 | node.removeEventListener(type, callback);
|
666 | });
|
667 | }
|
668 | }
|
669 | }
|
670 |
|
671 |
|
672 |
|
673 |
|
674 |
|
675 |
|
676 |
|
677 |
|
678 |
|
679 |
|
680 | function listenSelector(selector, type, callback) {
|
681 | return delegate(document.body, selector, type, callback);
|
682 | }
|
683 |
|
684 | module.exports = listen;
|
685 |
|
686 |
|
687 | }),
|
688 |
|
689 | 817:
|
690 | (function(module) {
|
691 |
|
692 | function select(element) {
|
693 | var selectedText;
|
694 |
|
695 | if (element.nodeName === 'SELECT') {
|
696 | element.focus();
|
697 |
|
698 | selectedText = element.value;
|
699 | }
|
700 | else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
|
701 | var isReadOnly = element.hasAttribute('readonly');
|
702 |
|
703 | if (!isReadOnly) {
|
704 | element.setAttribute('readonly', '');
|
705 | }
|
706 |
|
707 | element.select();
|
708 | element.setSelectionRange(0, element.value.length);
|
709 |
|
710 | if (!isReadOnly) {
|
711 | element.removeAttribute('readonly');
|
712 | }
|
713 |
|
714 | selectedText = element.value;
|
715 | }
|
716 | else {
|
717 | if (element.hasAttribute('contenteditable')) {
|
718 | element.focus();
|
719 | }
|
720 |
|
721 | var selection = window.getSelection();
|
722 | var range = document.createRange();
|
723 |
|
724 | range.selectNodeContents(element);
|
725 | selection.removeAllRanges();
|
726 | selection.addRange(range);
|
727 |
|
728 | selectedText = selection.toString();
|
729 | }
|
730 |
|
731 | return selectedText;
|
732 | }
|
733 |
|
734 | module.exports = select;
|
735 |
|
736 |
|
737 | }),
|
738 |
|
739 | 279:
|
740 | (function(module) {
|
741 |
|
742 | function E () {
|
743 |
|
744 |
|
745 | }
|
746 |
|
747 | E.prototype = {
|
748 | on: function (name, callback, ctx) {
|
749 | var e = this.e || (this.e = {});
|
750 |
|
751 | (e[name] || (e[name] = [])).push({
|
752 | fn: callback,
|
753 | ctx: ctx
|
754 | });
|
755 |
|
756 | return this;
|
757 | },
|
758 |
|
759 | once: function (name, callback, ctx) {
|
760 | var self = this;
|
761 | function listener () {
|
762 | self.off(name, listener);
|
763 | callback.apply(ctx, arguments);
|
764 | };
|
765 |
|
766 | listener._ = callback
|
767 | return this.on(name, listener, ctx);
|
768 | },
|
769 |
|
770 | emit: function (name) {
|
771 | var data = [].slice.call(arguments, 1);
|
772 | var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
773 | var i = 0;
|
774 | var len = evtArr.length;
|
775 |
|
776 | for (i; i < len; i++) {
|
777 | evtArr[i].fn.apply(evtArr[i].ctx, data);
|
778 | }
|
779 |
|
780 | return this;
|
781 | },
|
782 |
|
783 | off: function (name, callback) {
|
784 | var e = this.e || (this.e = {});
|
785 | var evts = e[name];
|
786 | var liveEvents = [];
|
787 |
|
788 | if (evts && callback) {
|
789 | for (var i = 0, len = evts.length; i < len; i++) {
|
790 | if (evts[i].fn !== callback && evts[i].fn._ !== callback)
|
791 | liveEvents.push(evts[i]);
|
792 | }
|
793 | }
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 | (liveEvents.length)
|
800 | ? e[name] = liveEvents
|
801 | : delete e[name];
|
802 |
|
803 | return this;
|
804 | }
|
805 | };
|
806 |
|
807 | module.exports = E;
|
808 | module.exports.TinyEmitter = E;
|
809 |
|
810 |
|
811 | })
|
812 |
|
813 | });
|
814 |
|
815 |
|
816 | var __webpack_module_cache__ = {};
|
817 |
|
818 |
|
819 | function __webpack_require__(moduleId) {
|
820 |
|
821 | if(__webpack_module_cache__[moduleId]) {
|
822 | return __webpack_module_cache__[moduleId].exports;
|
823 | }
|
824 |
|
825 | var module = __webpack_module_cache__[moduleId] = {
|
826 |
|
827 |
|
828 | exports: {}
|
829 | };
|
830 |
|
831 |
|
832 | __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
833 |
|
834 |
|
835 | return module.exports;
|
836 | }
|
837 |
|
838 |
|
839 |
|
840 | !function() {
|
841 |
|
842 | __webpack_require__.n = function(module) {
|
843 | var getter = module && module.__esModule ?
|
844 | function() { return module['default']; } :
|
845 | function() { return module; };
|
846 | __webpack_require__.d(getter, { a: getter });
|
847 | return getter;
|
848 | };
|
849 | }();
|
850 |
|
851 |
|
852 | !function() {
|
853 |
|
854 | __webpack_require__.d = function(exports, definition) {
|
855 | for(var key in definition) {
|
856 | if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
857 | Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
858 | }
|
859 | }
|
860 | };
|
861 | }();
|
862 |
|
863 |
|
864 | !function() {
|
865 | __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
866 | }();
|
867 |
|
868 |
|
869 |
|
870 |
|
871 |
|
872 | return __webpack_require__(686);
|
873 | })()
|
874 | .default;
|
875 | }); |
\ | No newline at end of file |