PluginProbe
Page Builder: Pagelayer – Drag and Drop website builder / 2.2.2
Page Builder: Pagelayer – Drag and Drop website builder v2.2.2
2.2.2 2.2.1 2.2.0 2.1.9 2.1.8 2.1.7 2.1.6 2.1.5 2.1.4 2.1.3 trunk 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5 0.9.6 0.9.7 0.9.8 0.9.9 1.0.0 1.0.2 1.0.3 1.0.4 All 130 releases
← All changes | js/vanilla-picker.js +8 -5 2.1.7 → 2.2.2 View file →
@@ -602,8 +602,9 @@
602 602 EVENT_CLICK_OUTSIDE = 'mousedown',
603 603 EVENT_TAB_MOVE = 'focusin';
604 604
605 605 function parseHTML(htmlString, doc) {
606 + doc = doc || document;
606 607 var div = doc.createElement('div');
607 608 div.innerHTML = htmlString;
608 609 return div.firstElementChild;
609 610 }
@@ -631,9 +632,9 @@
631 632 }
632 633
633 634 // Add the CSS
634 635 function appendCSS(doc){
635 -
636 + doc = doc || document;
636 637 if(doc.querySelector('#vanilla-picker-style')){
637 638 return;
638 639 }
639 640
@@ -652,8 +653,9 @@
652 653 var _this = this;
653 654
654 655 classCallCheck(this, Picker);
655 656
657 + options = options || {};
656 658
657 659 this.settings = {
658 660 popup: 'right',
659 661 layout: 'default',
@@ -658,9 +660,10 @@
658 660 popup: 'right',
659 661 layout: 'default',
660 662 alpha: true,
661 663 editor: true,
662 - editorFormat: 'hex'
664 + editorFormat: 'hex',
665 + doc: options.doc || document
663 666 };
664 667
665 668 this._openProxy = function (e) {
666 669 return _this.openHandler(e);
@@ -670,9 +673,9 @@
670 673 this.onDone = null;
671 674 this.onOpen = null;
672 675 this.onClose = null;
673 676
674 - appendCSS(options.doc);
677 + appendCSS(options.doc || document);
675 678
676 679 this.setOptions(options);
677 680 }
678 681
@@ -982,10 +985,10 @@
982 985 _this2.onDone(_this2.colour);
983 986 }
984 987 };
985 988
986 - addEvent(this.settings.doc, EVENT_CLICK_OUTSIDE, popupCloseProxy);
987 - addEvent(this.settings.doc, EVENT_TAB_MOVE, popupCloseProxy);
989 + addEvent(this.settings.doc || document, EVENT_CLICK_OUTSIDE, popupCloseProxy);
990 + addEvent(this.settings.doc || document, EVENT_TAB_MOVE, popupCloseProxy);
988 991 onKey(dom, ['Esc', 'Escape'], popupCloseProxy);
989 992
990 993 addEvent(this._domOkay, 'click', onDoneProxy);
991 994 onKey(dom, ['Enter'], onDoneProxy);