Skip to content

Commit 9cfd602

Browse files
authored
Merge pull request #2479 from magento-panda/PANDA-FIXES-2.2
Fixed issues: - MAGETWO-87731: An error happens when you have a new Critical Admin Notification and Release Notification window is opened
2 parents b330f86 + 5281114 commit 9cfd602

File tree

2 files changed

+13
-5
lines changed
  • app/code/Magento/Ui/view/base/web/js/modal
  • dev/tests/functional/tests/app/Magento/CatalogRule/Test/Page/Adminhtml

2 files changed

+13
-5
lines changed

app/code/Magento/Ui/view/base/web/js/modal/modal.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,12 @@ define([
336336
* Set z-index and margin for modal and overlay.
337337
*/
338338
_setActive: function () {
339-
var zIndex = this.modal.zIndex();
339+
var zIndex = this.modal.zIndex(),
340+
baseIndex = zIndex + this._getVisibleCount();
340341

342+
this.overlay.zIndex(++baseIndex);
341343
this.prevOverlayIndex = this.overlay.zIndex();
342-
this.modal.zIndex(zIndex + this._getVisibleCount());
343-
this.overlay.zIndex(zIndex + (this._getVisibleCount() - 1));
344+
this.modal.zIndex(this.overlay.zIndex() + 1);
344345

345346
if (this._getVisibleSlideCount()) {
346347
this.modal.css('marginLeft', this.options.modalLeftMargin * this._getVisibleSlideCount());
@@ -354,7 +355,14 @@ define([
354355
this.modal.removeAttr('style');
355356

356357
if (this.overlay) {
357-
this.overlay.zIndex(this.prevOverlayIndex);
358+
// In cases when one modal is closed but there is another modal open (e.g. admin notifications)
359+
// to avoid collisions between overlay and modal zIndexes
360+
// overlay zIndex is set to be less than modal one
361+
if (this._getVisibleCount() === 1) {
362+
this.overlay.zIndex(this.prevOverlayIndex - 1);
363+
} else {
364+
this.overlay.zIndex(this.prevOverlayIndex);
365+
}
358366
}
359367
},
360368

dev/tests/functional/tests/app/Magento/CatalogRule/Test/Page/Adminhtml/CatalogRuleNew.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<page name="CatalogRuleNew" area="Adminhtml" mca="catalog_rule/promo_catalog/new" module="Magento_CatalogRule">
1010
<block name="formPageActions" class="Magento\CatalogRule\Test\Block\Adminhtml\FormPageActions" locator=".page-main-actions" strategy="css selector"/>
1111
<block name="editForm" class="Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit\PromoForm" locator="[id='page:main-container']" strategy="css selector"/>
12-
<block name="modalBlock" class="Magento\Ui\Test\Block\Adminhtml\Modal" locator="._show[data-role=modal][style='z-index: 900;']" strategy="css selector"/>
12+
<block name="modalBlock" class="Magento\Ui\Test\Block\Adminhtml\Modal" locator="._show[data-role=modal][style='z-index: 902;']" strategy="css selector"/>
1313
</page>
1414
</config>

0 commit comments

Comments
 (0)