PluginProbe
Elementor Website Builder – more than just a page builder / 3.16.0-dev2
Elementor Website Builder – more than just a page builder v3.16.0-dev2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / assets / lib / dialog / dialog.js

dialog.js in Elementor Website Builder – more than just a page builder 3.16.0-dev2, at assets/lib/dialog/dialog.js

1,017 lines 20.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*!
2 * Dialogs Manager v4.9.0
3 * https://github.com/kobizz/dialogs-manager
4 *
5 * Copyright Kobi Zaltzberg
6 * Released under the MIT license
7 * https://github.com/kobizz/dialogs-manager/blob/master/LICENSE.txt
8 */
9
10 (function($, global) {
11 'use strict';
12
13 /*
14 * Dialog Manager
15 */
16 var DialogsManager = {
17 widgetsTypes: {},
18 createWidgetType: function(typeName, properties, Parent) {
19
20 if (!Parent) {
21 Parent = this.Widget;
22 }
23
24 var WidgetType = function() {
25
26 Parent.apply(this, arguments);
27 };
28
29 var prototype = WidgetType.prototype = new Parent(typeName);
30
31 prototype.types = prototype.types.concat([typeName]);
32
33 $.extend(prototype, properties);
34
35 prototype.constructor = WidgetType;
36
37 WidgetType.extend = function(typeName, properties) {
38
39 return DialogsManager.createWidgetType(typeName, properties, WidgetType);
40 };
41
42 return WidgetType;
43 },
44 addWidgetType: function(typeName, properties, Parent) {
45
46 if (properties && properties.prototype instanceof this.Widget) {
47 return this.widgetsTypes[typeName] = properties;
48 }
49
50 return this.widgetsTypes[typeName] = this.createWidgetType(typeName, properties, Parent);
51 },
52 getWidgetType: function(widgetType) {
53
54 return this.widgetsTypes[widgetType];
55 }
56 };
57
58 /*
59 * Dialog Manager instances constructor
60 */
61 DialogsManager.Instance = function() {
62
63 var self = this,
64 elements = {},
65 settings = {};
66
67 var initElements = function() {
68
69 elements.body = $('body');
70 };
71
72 var initSettings = function(options) {
73
74 var defaultSettings = {
75 classPrefix: 'dialog',
76 effects: {
77 show: 'fadeIn',
78 hide: 'fadeOut'
79 }
80 };
81
82 $.extend(settings, defaultSettings, options);
83 };
84
85 this.createWidget = function(widgetType, properties) {
86
87 var WidgetTypeConstructor = DialogsManager.getWidgetType(widgetType),
88 widget = new WidgetTypeConstructor(widgetType);
89
90 properties = properties || {};
91
92 widget.init(self, properties);
93
94 return widget;
95 };
96
97 this.getSettings = function(property) {
98
99 if (property) {
100 return settings[property];
101 }
102
103 return Object.create(settings);
104 };
105
106 this.init = function(settings) {
107
108 initSettings(settings);
109
110 initElements();
111
112 return self;
113 };
114
115 self.init();
116 };
117
118 /*
119 * Widget types constructor
120 */
121 DialogsManager.Widget = function(widgetName) {
122
123 var self = this,
124 settings = {},
125 events = {},
126 elements = {},
127 hideTimeOut = 0,
128 baseClosureMethods = ['refreshPosition'];
129
130 var bindEvents = function() {
131
132 var windows = [elements.window];
133
134 if (elements.iframe) {
135 windows.push(jQuery(elements.iframe[0].contentWindow));
136 }
137
138 windows.forEach(function(window) {
139 if (settings.hide.onEscKeyPress) {
140 window.on('keyup', onWindowKeyUp);
141 }
142
143 if (settings.hide.onOutsideClick) {
144 window[0].addEventListener('click', hideOnOutsideClick, true);
145 }
146
147 if (settings.hide.onOutsideContextMenu) {
148 window[0].addEventListener('contextmenu', hideOnOutsideClick, true);
149 }
150
151 if (settings.position.autoRefresh) {
152 window.on('resize', self.refreshPosition);
153 }
154 });
155
156 if (settings.hide.onClick || settings.hide.onBackgroundClick) {
157 elements.widget.on('click', hideOnClick);
158 }
159 };
160
161 var callEffect = function(intent, params) {
162
163 var effect = settings.effects[intent],
164 $widget = elements.widget;
165
166 if ($.isFunction(effect)) {
167 effect.apply($widget, params);
168 } else {
169
170 if ($widget[effect]) {
171 $widget[effect].apply($widget, params);
172 } else {
173 throw 'Reference Error: The effect ' + effect + ' not found';
174 }
175 }
176 };
177
178 var ensureClosureMethods = function() {
179
180 var closureMethodsNames = baseClosureMethods.concat(self.getClosureMethods());
181
182 $.each(closureMethodsNames, function() {
183
184 var methodName = this,
185 oldMethod = self[methodName];
186
187 self[methodName] = function() {
188
189 oldMethod.apply(self, arguments);
190 };
191 });
192 };
193
194 var fixIframePosition = function(position) {
195 if (! position.my) {
196 return;
197 }
198
199 var horizontalOffsetRegex = /left|right/,
200 extraOffsetRegex = /([+-]\d+)?$/,
201 iframeOffset = elements.iframe.offset(),
202 iframeWindow = elements.iframe[0].contentWindow,
203 myParts = position.my.split(' '),
204 fixedParts = [];
205
206 if (myParts.length === 1) {
207 if (horizontalOffsetRegex.test(myParts[0])) {
208 myParts.push('center');
209 } else {
210 myParts.unshift('center');
211 }
212 }
213
214 myParts.forEach(function(part, index) {
215 var fixedPart = part.replace(extraOffsetRegex, function(partOffset) {
216 partOffset = +partOffset || 0;
217
218 if (! index) {
219 partOffset += iframeOffset.left - iframeWindow.scrollX;
220 } else {
221 partOffset += iframeOffset.top - iframeWindow.scrollY;
222 }
223
224 if (partOffset >= 0) {
225 partOffset = '+' + partOffset;
226 }
227
228 return partOffset;
229 });
230
231 fixedParts.push(fixedPart);
232 });
233
234 position.my = fixedParts.join(' ');
235 };
236
237 var hideOnClick = function(event) {
238
239 if (isContextMenuClickEvent(event)) {
240 return;
241 }
242
243 if (settings.hide.onClick) {
244
245 if ($(event.target).closest(settings.selectors.preventClose).length) {
246 return;
247 }
248 } else if (event.target !== this) {
249 return;
250 }
251
252 self.hide();
253 };
254
255 var isIgnoredTarget = function(event) {
256
257 if (! settings.hide.ignore) {
258 return false;
259 }
260
261 return !! $(event.target).closest(settings.hide.ignore).length;
262 };
263
264 var hideOnOutsideClick = function(event) {
265
266 if (isContextMenuClickEvent(event) || $(event.target).closest(elements.widget).length || isIgnoredTarget(event)) {
267 return;
268 }
269
270 self.hide();
271 };
272
273 var initElements = function() {
274
275 self.addElement('widget');
276
277 self.addElement('header');
278
279 self.addElement('message');
280
281 self.addElement('window', window);
282
283 self.addElement('body', document.body);
284
285 self.addElement('container', settings.container);
286
287 if (settings.iframe) {
288 self.addElement('iframe', settings.iframe);
289 }
290
291 if (settings.closeButton) {
292 if ( settings.closeButtonClass ) {
293 // Backwards compatibility
294 settings.closeButtonOptions.iconClass = settings.closeButtonClass;
295 }
296
297 const $button = $('<a>', settings.closeButtonOptions.attributes),
298 $buttonIcon = $(settings.closeButtonOptions.iconElement).addClass(settings.closeButtonOptions.iconClass);
299
300 $button.append($buttonIcon);
301
302 self.addElement('closeButton', $button);
303 }
304
305 var id = self.getSettings('id');
306
307 if (id) {
308 self.setID(id);
309 }
310
311 var classes = [];
312
313 $.each(self.types, function() {
314 classes.push(settings.classes.globalPrefix + '-type-' + this);
315 });
316
317 classes.push(self.getSettings('className'));
318
319 elements.widget
320 .addClass(classes.join(' '))
321 .attr({
322 'aria-modal': true,
323 'role': 'document',
324 'tabindex': 0,
325 });
326 };
327
328 var initSettings = function(parent, userSettings) {
329
330 var parentSettings = $.extend(true, {}, parent.getSettings());
331
332 settings = {
333 headerMessage: '',
334 message: '',
335 effects: parentSettings.effects,
336 classes: {
337 globalPrefix: parentSettings.classPrefix,
338 prefix: parentSettings.classPrefix + '-' + widgetName,
339 preventScroll: parentSettings.classPrefix + '-prevent-scroll'
340 },
341 selectors: {
342 preventClose: '.' + parentSettings.classPrefix + '-prevent-close'
343 },
344 container: 'body',
345 preventScroll: false,
346 iframe: null,
347 closeButton: false,
348 closeButtonOptions: {
349 iconClass: parentSettings.classPrefix + '-close-button-icon',
350 attributes: {
351 role: 'button',
352 'tabindex': 0,
353 'aria-label': 'Close',
354 href: 'javascript:void(0);',
355 },
356 iconElement: '<i>',
357 },
358 position: {
359 element: 'widget',
360 my: 'center',
361 at: 'center',
362 enable: true,
363 autoRefresh: false
364 },
365 hide: {
366 auto: false,
367 autoDelay: 5000,
368 onClick: false,
369 onOutsideClick: true,
370 onOutsideContextMenu: false,
371 onBackgroundClick: true,
372 onEscKeyPress: true,
373 ignore: ''
374 },
375 };
376
377 $.extend(true, settings, self.getDefaultSettings(), userSettings);
378
379 initSettingsEvents();
380 };
381
382 var initSettingsEvents = function() {
383
384 $.each(settings, function(settingKey) {
385
386 var eventName = settingKey.match(/^on([A-Z].*)/);
387
388 if (!eventName) {
389 return;
390 }
391
392 eventName = eventName[1].charAt(0).toLowerCase() + eventName[1].slice(1);
393
394 self.on(eventName, this);
395 });
396 };
397
398 var isContextMenuClickEvent = function(event) {
399 // Firefox fires `click` event on every `contextmenu` event.
400 return event.type === 'click' && event.button === 2;
401 };
402
403 var normalizeClassName = function(name) {
404
405 return name.replace(/([a-z])([A-Z])/g, function() {
406
407 return arguments[1] + '-' + arguments[2].toLowerCase();
408 });
409 };
410
411 var onWindowKeyUp = function(event) {
412 var ESC_KEY = 27,
413 keyCode = event.which;
414
415 if (ESC_KEY === keyCode) {
416 self.hide();
417 }
418 };
419
420 var unbindEvents = function() {
421
422 var windows = [elements.window];
423
424 if (elements.iframe) {
425 windows.push(jQuery(elements.iframe[0].contentWindow));
426 }
427
428 windows.forEach(function(window) {
429 if (settings.hide.onEscKeyPress) {
430 window.off('keyup', onWindowKeyUp);
431 }
432
433 if (settings.hide.onOutsideClick) {
434 window[0].removeEventListener('click', hideOnOutsideClick, true);
435 }
436
437 if (settings.hide.onOutsideContextMenu) {
438 window[0].removeEventListener('contextmenu', hideOnOutsideClick, true);
439 }
440
441 if (settings.position.autoRefresh) {
442 window.off('resize', self.refreshPosition);
443 }
444 });
445
446 if (settings.hide.onClick || settings.hide.onBackgroundClick) {
447 elements.widget.off('click', hideOnClick);
448 }
449 };
450
451 this.addElement = function(name, element, classes) {
452
453 var $newElement = elements[name] = $(element || '<div>'),
454 normalizedName = normalizeClassName(name);
455
456 classes = classes ? classes + ' ' : '';
457
458 classes += settings.classes.globalPrefix + '-' + normalizedName;
459
460 classes += ' ' + settings.classes.prefix + '-' + normalizedName;
461
462 $newElement.addClass(classes);
463
464 return $newElement;
465 };
466
467 this.destroy = function() {
468
469 unbindEvents();
470
471 elements.widget.remove();
472
473 self.trigger('destroy');
474
475 return self;
476 };
477
478 this.getElements = function(item) {
479
480 return item ? elements[item] : elements;
481 };
482
483 this.getSettings = function(setting) {
484
485 var copy = Object.create(settings);
486
487 if (setting) {
488 return copy[setting];
489 }
490
491 return copy;
492 };
493
494 this.hide = function() {
495
496 if (! self.isVisible()) {
497 return;
498 }
499
500 clearTimeout(hideTimeOut);
501
502 callEffect('hide', arguments);
503
504 unbindEvents();
505
506 if (settings.preventScroll) {
507 self.getElements('body').removeClass(settings.classes.preventScroll);
508 }
509
510 self.trigger('hide');
511
512 return self;
513 };
514
515 this.init = function(parent, properties) {
516
517 if (!(parent instanceof DialogsManager.Instance)) {
518 throw 'The ' + self.widgetName + ' must to be initialized from an instance of DialogsManager.Instance';
519 }
520
521 ensureClosureMethods();
522
523 self.trigger('init', properties);
524
525 initSettings(parent, properties);
526
527 initElements();
528
529 self.buildWidget();
530
531 self.attachEvents();
532
533 self.trigger('ready');
534
535 return self;
536 };
537
538 this.isVisible = function() {
539
540 return elements.widget.is(':visible');
541 };
542
543 this.on = function(eventName, callback) {
544
545 if ('object' === typeof eventName) {
546 $.each(eventName, function(singleEventName) {
547 self.on(singleEventName, this);
548 });
549
550 return self;
551 }
552
553 var eventNames = eventName.split(' ');
554
555 eventNames.forEach(function(singleEventName) {
556 if (!events[singleEventName]) {
557 events[singleEventName] = [];
558 }
559
560 events[singleEventName].push(callback);
561 });
562
563 return self;
564 };
565
566 this.off = function(eventName, callback) {
567
568 if (! events[ eventName ]) {
569 return self;
570 }
571
572 if (! callback) {
573 delete events[eventName];
574
575 return self;
576 }
577
578 var callbackIndex = events[eventName].indexOf(callback);
579
580 if (-1 !== callbackIndex) {
581 events[eventName].splice(callbackIndex, 1);
582 }
583
584 return self;
585 };
586
587 this.refreshPosition = function() {
588
589 if (! settings.position.enable) {
590 return;
591 }
592
593 var position = $.extend({}, settings.position);
594
595 if (elements[position.of]) {
596 position.of = elements[position.of];
597 }
598
599 if (! position.of) {
600 position.of = window;
601 }
602
603 if (settings.iframe) {
604 fixIframePosition(position);
605 }
606
607 elements[position.element].position(position);
608 };
609
610 this.setID = function(id) {
611
612 elements.widget.attr('id', id);
613
614 return self;
615 };
616
617 this.setHeaderMessage = function(message) {
618
619 self.getElements('header').html(message);
620
621 return self;
622 };
623
624 this.setMessage = function(message) {
625
626 elements.message.html(message);
627
628 return self;
629 };
630
631 this.setSettings = function(key, value) {
632
633 if (jQuery.isPlainObject(value)) {
634 $.extend(true, settings[key], value);
635 } else {
636 settings[key] = value;
637 }
638
639 return self;
640 };
641
642 this.show = function() {
643
644 clearTimeout(hideTimeOut);
645
646 elements.widget.appendTo(elements.container).hide();
647
648 callEffect('show', arguments);
649
650 self.refreshPosition();
651
652 if (settings.hide.auto) {
653 hideTimeOut = setTimeout(self.hide, settings.hide.autoDelay);
654 }
655
656 bindEvents();
657
658 if (settings.preventScroll) {
659 self.getElements('body').addClass(settings.classes.preventScroll);
660 }
661
662 self.trigger('show');
663
664 return self;
665 };
666
667 this.trigger = function(eventName, params) {
668
669 var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1);
670
671 if (self[methodName]) {
672 self[methodName](params);
673 }
674
675 var callbacks = events[eventName];
676
677 if (!callbacks) {
678 return;
679 }
680
681 $.each(callbacks, function(index, callback) {
682
683 callback.call(self, params);
684 });
685
686 return self;
687 };
688 };
689
690 DialogsManager.Widget.prototype.types = [];
691
692 // Inheritable widget methods
693 DialogsManager.Widget.prototype.buildWidget = function() {
694
695 var elements = this.getElements(),
696 settings = this.getSettings();
697
698 elements.widget.append(elements.header, elements.message);
699
700 this.setHeaderMessage(settings.headerMessage);
701
702 this.setMessage(settings.message);
703
704 if (this.getSettings('closeButton')) {
705 elements.widget.prepend(elements.closeButton);
706 }
707 };
708
709 DialogsManager.Widget.prototype.attachEvents = function() {
710
711 var self = this;
712
713 if (self.getSettings('closeButton')) {
714 self.getElements('closeButton').on('click', function() {
715 self.hide();
716 });
717 }
718 };
719
720 DialogsManager.Widget.prototype.getDefaultSettings = function() {
721
722 return {};
723 };
724
725 DialogsManager.Widget.prototype.getClosureMethods = function() {
726
727 return [];
728 };
729
730 DialogsManager.Widget.prototype.onHide = function() {
731 };
732
733 DialogsManager.Widget.prototype.onShow = function() {
734 };
735
736 DialogsManager.Widget.prototype.onInit = function() {
737 };
738
739 DialogsManager.Widget.prototype.onReady = function() {
740 };
741
742 DialogsManager.widgetsTypes.simple = DialogsManager.Widget;
743
744 DialogsManager.addWidgetType('buttons', {
745 activeKeyUp: function(event) {
746
747 var TAB_KEY = 9;
748
749 if (event.which === TAB_KEY) {
750 event.preventDefault();
751 }
752
753 if (this.hotKeys[event.which]) {
754 this.hotKeys[event.which](this);
755 }
756 },
757 activeKeyDown: function(event) {
758
759 if (!this.focusedButton) {
760 return;
761 }
762
763 var TAB_KEY = 9;
764
765 if (event.which === TAB_KEY) {
766 event.preventDefault();
767
768 var currentButtonIndex = this.focusedButton.index(),
769 nextButtonIndex;
770
771 if (event.shiftKey) {
772
773 nextButtonIndex = currentButtonIndex - 1;
774
775 if (nextButtonIndex < 0) {
776 nextButtonIndex = this.buttons.length - 1;
777 }
778 } else {
779
780 nextButtonIndex = currentButtonIndex + 1;
781
782 if (nextButtonIndex >= this.buttons.length) {
783 nextButtonIndex = 0;
784 }
785 }
786
787 this.focusedButton = this.buttons[nextButtonIndex].focus();
788 }
789 },
790 addButton: function(options) {
791
792 var self = this,
793 settings = self.getSettings(),
794 buttonSettings = jQuery.extend(settings.button, options);
795
796 var classes = options.classes ? options.classes + ' ' : '';
797
798 classes += settings.classes.globalPrefix + '-button';
799
800 var $button = self.addElement(options.name, $('<' + buttonSettings.tag + '>').html(options.text), classes);
801
802 self.buttons.push($button);
803
804 var buttonFn = function() {
805
806 if (settings.hide.onButtonClick) {
807 self.hide();
808 }
809
810 if ($.isFunction(options.callback)) {
811 options.callback.call(this, self);
812 }
813 };
814
815 $button.on('click', buttonFn);
816
817 if (options.hotKey) {
818 this.hotKeys[options.hotKey] = buttonFn;
819 }
820
821 this.getElements('buttonsWrapper').append($button);
822
823 if (options.focus) {
824 this.focusedButton = $button;
825 }
826
827 return self;
828 },
829 bindHotKeys: function() {
830
831 this.getElements('window').on({
832 keyup: this.activeKeyUp,
833 keydown: this.activeKeyDown
834 });
835 },
836 buildWidget: function() {
837
838 DialogsManager.Widget.prototype.buildWidget.apply(this, arguments);
839
840 var $buttonsWrapper = this.addElement('buttonsWrapper');
841
842 this.getElements('widget').append($buttonsWrapper);
843 },
844 getClosureMethods: function() {
845
846 return [
847 'activeKeyUp',
848 'activeKeyDown'
849 ];
850 },
851 getDefaultSettings: function() {
852
853 return {
854 hide: {
855 onButtonClick: true
856 },
857 button: {
858 tag: 'button'
859 }
860 };
861 },
862 onHide: function() {
863
864 this.unbindHotKeys();
865 },
866 onInit: function() {
867
868 this.buttons = [];
869
870 this.hotKeys = {};
871
872 this.focusedButton = null;
873 },
874 onShow: function() {
875
876 this.bindHotKeys();
877
878 if (!this.focusedButton) {
879 this.focusedButton = this.buttons[0];
880 }
881
882 if (this.focusedButton) {
883 this.focusedButton.focus();
884 }
885 },
886 unbindHotKeys: function() {
887
888 this.getElements('window').off({
889 keyup: this.activeKeyUp,
890 keydown: this.activeKeyDown
891 });
892 }
893 });
894
895 DialogsManager.addWidgetType('lightbox', DialogsManager.getWidgetType('buttons').extend('lightbox', {
896 getDefaultSettings: function() {
897
898 var settings = DialogsManager.getWidgetType('buttons').prototype.getDefaultSettings.apply(this, arguments);
899
900 return $.extend(true, settings, {
901 contentWidth: 'auto',
902 contentHeight: 'auto',
903 position: {
904 element: 'widgetContent',
905 of: 'widget',
906 autoRefresh: true
907 }
908 });
909 },
910 buildWidget: function() {
911
912 DialogsManager.getWidgetType('buttons').prototype.buildWidget.apply(this, arguments);
913
914 var $widgetContent = this.addElement('widgetContent'),
915 elements = this.getElements();
916
917 $widgetContent.append(elements.header, elements.message, elements.buttonsWrapper);
918
919 elements.widget.html($widgetContent);
920
921 if (elements.closeButton) {
922 $widgetContent.prepend(elements.closeButton);
923 }
924 },
925 onReady: function() {
926
927 var elements = this.getElements(),
928 settings = this.getSettings();
929
930 if ('auto' !== settings.contentWidth) {
931 elements.message.width(settings.contentWidth);
932 }
933
934 if ('auto' !== settings.contentHeight) {
935 elements.message.height(settings.contentHeight);
936 }
937 }
938 }));
939
940 DialogsManager.addWidgetType('confirm', DialogsManager.getWidgetType('lightbox').extend('confirm', {
941 onReady: function() {
942
943 DialogsManager.getWidgetType('lightbox').prototype.onReady.apply(this, arguments);
944
945 var strings = this.getSettings('strings'),
946 isDefaultCancel = this.getSettings('defaultOption') === 'cancel';
947
948 this.addButton({
949 name: 'cancel',
950 text: strings.cancel,
951 callback: function(widget) {
952
953 widget.trigger('cancel');
954 },
955 focus: isDefaultCancel
956 });
957
958 this.addButton({
959 name: 'ok',
960 text: strings.confirm,
961 callback: function(widget) {
962
963 widget.trigger('confirm');
964 },
965 focus: !isDefaultCancel
966 });
967 },
968 getDefaultSettings: function() {
969
970 var settings = DialogsManager.getWidgetType('lightbox').prototype.getDefaultSettings.apply(this, arguments);
971
972 settings.strings = {
973 confirm: 'OK',
974 cancel: 'Cancel'
975 };
976
977 settings.defaultOption = 'cancel';
978
979 return settings;
980 }
981 }));
982
983 DialogsManager.addWidgetType('alert', DialogsManager.getWidgetType('lightbox').extend('alert', {
984 onReady: function() {
985
986 DialogsManager.getWidgetType('lightbox').prototype.onReady.apply(this, arguments);
987
988 var strings = this.getSettings('strings');
989
990 this.addButton({
991 name: 'ok',
992 text: strings.confirm,
993 callback: function(widget) {
994
995 widget.trigger('confirm');
996 }
997 });
998 },
999 getDefaultSettings: function() {
1000
1001 var settings = DialogsManager.getWidgetType('lightbox').prototype.getDefaultSettings.apply(this, arguments);
1002
1003 settings.strings = {
1004 confirm: 'OK'
1005 };
1006
1007 return settings;
1008 }
1009 }));
1010
1011 // Exporting the DialogsManager variable to global
1012 global.DialogsManager = DialogsManager;
1013 })(
1014 typeof jQuery !== 'undefined' ? jQuery : typeof require === 'function' && require('jquery'),
1015 (typeof module !== 'undefined' && typeof module.exports !== 'undefined') ? module.exports : window
1016 );
1017