Skip to content

Commit f0dbeb6

Browse files
AC-1445: Unable to click Underline in TinyMCE on PageBuilder
1 parent 9c8d636 commit f0dbeb6

File tree

2 files changed

+47
-36
lines changed

2 files changed

+47
-36
lines changed

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

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ define([
1414
'text!ui/template/modal/modal-slide.html',
1515
'text!ui/template/modal/modal-custom.html',
1616
'Magento_Ui/js/lib/key-codes',
17+
'jquery/patches/z-index',
1718
'jquery-ui-modules/widget',
1819
'jquery-ui-modules/core',
1920
'mage/translate'
20-
], function ($, _, template, popupTpl, slideTpl, customTpl, keyCodes) {
21+
], function ($, _, template, popupTpl, slideTpl, customTpl, keyCodes, zIndex) {
2122
'use strict';
2223

2324
/**
@@ -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,8 +342,8 @@ define([
373342
* Set z-index and margin for modal and overlay.
374343
*/
375344
_setActive: function () {
376-
var zIndex = getZIndex(this.modal),
377-
baseIndex = zIndex + this._getVisibleCount();
345+
var zIndexValue = zIndex.getValue(this.modal),
346+
baseIndex = zIndexValue + this._getVisibleCount();
378347

379348
if (this.modal.data('active')) {
380349
return;

lib/web/jquery/patches/z-index.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([], function () {
7+
'use strict';
8+
9+
return {
10+
/**
11+
* Implementation of zIndex used from jQuery UI
12+
* @param {Element} elem
13+
* @private
14+
*/
15+
getValue: function (elem) {
16+
var position, zIndex;
17+
18+
/* eslint-disable max-depth */
19+
while (elem.length && elem[0] !== document) {
20+
// Ignore z-index if position is set to a value where z-index is ignored by the browser
21+
// This makes behavior of this function consistent across browsers
22+
// WebKit always returns auto if the element is positioned
23+
position = elem.css('position');
24+
25+
if (position === 'absolute' || position === 'relative' || position === 'fixed') {
26+
// IE returns 0 when zIndex is not specified
27+
// other browsers return a string
28+
// we ignore the case of nested elements with an explicit value of 0
29+
zIndex = parseInt(elem.css('zIndex'), 10);
30+
31+
if (!isNaN(zIndex) && zIndex !== 0) {
32+
return zIndex;
33+
}
34+
}
35+
elem = elem.parent();
36+
}
37+
38+
return 0;
39+
/* eslint-enable max-depth */
40+
}
41+
}
42+
});

0 commit comments

Comments
 (0)