Skip to content

Commit 425e557

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

File tree

3 files changed

+56
-51
lines changed

3 files changed

+56
-51
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +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',
1817
'jquery-ui-modules/widget',
1918
'jquery-ui-modules/core',
20-
'mage/translate'
21-
], function ($, _, template, popupTpl, slideTpl, customTpl, keyCodes, zIndex) {
19+
'mage/translate',
20+
'jquery/z-index'
21+
], function ($, _, template, popupTpl, slideTpl, customTpl, keyCodes) {
2222
'use strict';
2323

2424
/**
@@ -342,17 +342,18 @@ define([
342342
* Set z-index and margin for modal and overlay.
343343
*/
344344
_setActive: function () {
345-
var zIndexValue = zIndex.getValue(this.modal),
346-
baseIndex = zIndexValue + this._getVisibleCount();
345+
var zIndex = this.modal.zIndex(),
346+
baseIndex = zIndex + this._getVisibleCount();
347347

348348
if (this.modal.data('active')) {
349349
return;
350350
}
351+
351352
this.modal.data('active', true);
352353

353-
this.overlay.css('z-index', ++baseIndex);
354-
this.prevOverlayIndex = baseIndex;
355-
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);
356357

357358
if (this._getVisibleSlideCount()) {
358359
this.modal.css('marginLeft', this.options.modalLeftMargin * this._getVisibleSlideCount());
@@ -367,7 +368,7 @@ define([
367368
this.modal.data('active', false);
368369

369370
if (this.overlay) {
370-
this.overlay.css('z-index', this.prevOverlayIndex - 1);
371+
this.overlay.zIndex(this.prevOverlayIndex - 1);
371372
}
372373
},
373374

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

Lines changed: 0 additions & 42 deletions
This file was deleted.

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)