| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /*! |
| 2 | - * Dialogs Manager v4.9.4 | |
| 2 | + * Dialogs Manager v4.9.3 | |
| 3 | 3 | * https://github.com/kobizz/dialogs-manager |
| 4 | 4 | * |
| 5 | 5 | * Copyright Kobi Zaltzberg |
| 6 | 6 | * Released under the MIT license |
| @@ -62,10 +62,8 @@ | ||
| 62 | 62 | |
| 63 | 63 | var self = this, |
| 64 | 64 | elements = {}, |
| 65 | 65 | settings = {}; |
| 66 | - | |
| 67 | - self.openDialogs = []; | |
| 68 | 66 | |
| 69 | 67 | var initElements = function() { |
| 70 | 68 | |
| 71 | 69 | elements.body = $('body'); |
| @@ -482,15 +480,9 @@ | ||
| 482 | 480 | return $newElement; |
| 483 | 481 | }; |
| 484 | 482 | |
| 485 | 483 | this.destroy = function() { |
| 486 | - const widgetId = self.getElements('widget')?.attr('id'), | |
| 487 | - index = self.parent.openDialogs.lastIndexOf(widgetId); | |
| 488 | 484 | |
| 489 | - if (index !== -1) { | |
| 490 | - self.parent.openDialogs.splice(index, 1); | |
| 491 | - } | |
| 492 | - | |
| 493 | 485 | unbindEvents(); |
| 494 | 486 | |
| 495 | 487 | elements.widget.remove(); |
| 496 | 488 | |
| @@ -520,18 +512,8 @@ | ||
| 520 | 512 | if (! self.isVisible()) { |
| 521 | 513 | return; |
| 522 | 514 | } |
| 523 | 515 | |
| 524 | - const widgetId = self.getElements('widget')?.attr('id'), | |
| 525 | - openDialogs = self.parent.openDialogs, | |
| 526 | - topDialogId = openDialogs[openDialogs.length - 1]; | |
| 527 | - | |
| 528 | - if (topDialogId !== widgetId) { | |
| 529 | - return; | |
| 530 | - } | |
| 531 | - | |
| 532 | - openDialogs.pop(); | |
| 533 | - | |
| 534 | 516 | clearTimeout(hideTimeOut); |
| 535 | 517 | |
| 536 | 518 | callEffect('hide', arguments); |
| 537 | 519 | |
| @@ -551,10 +533,8 @@ | ||
| 551 | 533 | if (!(parent instanceof DialogsManager.Instance)) { |
| 552 | 534 | throw 'The ' + self.widgetName + ' must to be initialized from an instance of DialogsManager.Instance'; |
| 553 | 535 | } |
| 554 | 536 | |
| 555 | - self.parent = parent; | |
| 556 | - | |
| 557 | 537 | ensureClosureMethods(); |
| 558 | 538 | |
| 559 | 539 | self.trigger('init', properties); |
| 560 | 540 | |
| @@ -695,12 +675,8 @@ | ||
| 695 | 675 | self.getElements('body').addClass(settings.classes.preventScroll); |
| 696 | 676 | } |
| 697 | 677 | |
| 698 | 678 | self.trigger('show'); |
| 699 | - | |
| 700 | - const widgetId = self.getElements('widget')?.attr('id'); | |
| 701 | - | |
| 702 | - self.parent.openDialogs.push(widgetId); | |
| 703 | 679 | |
| 704 | 680 | return self; |
| 705 | 681 | }; |
| 706 | 682 | |