Skip to content

Commit 8d9f11f

Browse files
committed
Merge remote-tracking branch 'upstream/2.4-develop' into B2B-2015
2 parents 5763e90 + ba0b59c commit 8d9f11f

File tree

4 files changed

+60
-40
lines changed

4 files changed

+60
-40
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryFilterSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCategoryFilterSection">
1212
<element name="CategoryFilter" type="button" selector="//main//div[contains(@class,'filter-options')]//div[contains(text(), 'Category')]"/>
13-
<element name="CategoryByName" type="button" selector="//main//div[@class='filter-options']//li[@class='item']//a[contains(text(), '{{var1}}')]" parameterized="true"/>
13+
<element name="CategoryByName" type="button" selector="//main//div[contains(@class,'filter-options')]//li[@class='item']//a[contains(text(), '{{var1}}')]" parameterized="true"/>
1414
</section>
1515
</sections>

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

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ define([
1616
'Magento_Ui/js/lib/key-codes',
1717
'jquery-ui-modules/widget',
1818
'jquery-ui-modules/core',
19-
'mage/translate'
19+
'mage/translate',
20+
'jquery/z-index'
2021
], function ($, _, template, popupTpl, slideTpl, customTpl, keyCodes) {
2122
'use strict';
2223

@@ -39,39 +40,7 @@ define([
3940
return transitions[transition];
4041
}
4142
}
42-
})(),
43-
44-
/**
45-
* Implementation of zIndex used from jQuery UI
46-
* @param {Element} elem
47-
* @private
48-
*/
49-
getZIndex = function (elem) {
50-
var position, zIndex;
51-
52-
/* eslint-disable max-depth */
53-
while (elem.length && elem[ 0 ] !== document) {
54-
// Ignore z-index if position is set to a value where z-index is ignored by the browser
55-
// This makes behavior of this function consistent across browsers
56-
// WebKit always returns auto if the element is positioned
57-
position = elem.css('position');
58-
59-
if (position === 'absolute' || position === 'relative' || position === 'fixed') {
60-
// IE returns 0 when zIndex is not specified
61-
// other browsers return a string
62-
// we ignore the case of nested elements with an explicit value of 0
63-
zIndex = parseInt(elem.css('zIndex'), 10);
64-
65-
if (!isNaN(zIndex) && zIndex !== 0) {
66-
return zIndex;
67-
}
68-
}
69-
elem = elem.parent();
70-
}
71-
72-
return 0;
73-
/* eslint-enable max-depth */
74-
};
43+
})();
7544

7645
/**
7746
* Modal Window Widget
@@ -373,17 +342,18 @@ define([
373342
* Set z-index and margin for modal and overlay.
374343
*/
375344
_setActive: function () {
376-
var zIndex = getZIndex(this.modal),
345+
var zIndex = this.modal.zIndex(),
377346
baseIndex = zIndex + this._getVisibleCount();
378347

379348
if (this.modal.data('active')) {
380349
return;
381350
}
351+
382352
this.modal.data('active', true);
383353

384-
this.overlay.css('z-index', ++baseIndex);
385-
this.prevOverlayIndex = baseIndex;
386-
this.modal.css('z-index', baseIndex + 1);
354+
this.overlay.zIndex(++baseIndex);
355+
this.prevOverlayIndex = this.overlay.zIndex();
356+
this.modal.zIndex(this.overlay.zIndex() + 1);
387357

388358
if (this._getVisibleSlideCount()) {
389359
this.modal.css('marginLeft', this.options.modalLeftMargin * this._getVisibleSlideCount());
@@ -398,7 +368,7 @@ define([
398368
this.modal.data('active', false);
399369

400370
if (this.overlay) {
401-
this.overlay.css('z-index', this.prevOverlayIndex - 1);
371+
this.overlay.zIndex(this.prevOverlayIndex - 1);
402372
}
403373
},
404374

dev/tests/unit/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
<testsuite name="Magento_Unit_Tests_App_Code">
2929
<directory>../../../app/code/*/*/Test/Unit</directory>
3030
<directory>../../../vendor/magento/module-*/Test/Unit</directory>
31+
<exclude>../../../app/code/Magento/Indexer/Test/Unit</exclude>
32+
</testsuite>
33+
<testsuite name="Magento_Unit_Tests_App_Code_Indexer">
34+
<directory>../../../app/code/Magento/Indexer/Test/Unit</directory>
3135
</testsuite>
3236
<testsuite name="Magento_Unit_Tests_Other">
3337
<directory>../../../lib/internal/*/*/Test/Unit</directory>

lib/web/jquery/z-index.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*!
2+
* zIndex plugin from jQuery UI Core - v1.10.4
3+
* http://jqueryui.com
4+
*
5+
* Copyright 2014 jQuery Foundation and other contributors
6+
* Released under the MIT license.
7+
* http://jquery.org/license
8+
*
9+
* http://api.jqueryui.com/category/ui-core/
10+
*/
11+
define([
12+
'jquery'
13+
], function ($, undefined) {
14+
15+
// plugins
16+
$.fn.extend({
17+
zIndex: function (zIndex) {
18+
if (zIndex !== undefined) {
19+
return this.css("zIndex", zIndex);
20+
}
21+
22+
if (this.length) {
23+
var elem = $(this[0]), position, value;
24+
while (elem.length && elem[0] !== document) {
25+
// Ignore z-index if position is set to a value where z-index is ignored by the browser
26+
// This makes behavior of this function consistent across browsers
27+
// WebKit always returns auto if the element is positioned
28+
position = elem.css("position");
29+
if (position === "absolute" || position === "relative" || position === "fixed") {
30+
// IE returns 0 when zIndex is not specified
31+
// other browsers return a string
32+
// we ignore the case of nested elements with an explicit value of 0
33+
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
34+
value = parseInt(elem.css("zIndex"), 10);
35+
if (!isNaN(value) && value !== 0) {
36+
return value;
37+
}
38+
}
39+
elem = elem.parent();
40+
}
41+
}
42+
43+
return 0;
44+
}
45+
});
46+
});

0 commit comments

Comments
 (0)