Skip to content

Commit 13174eb

Browse files
author
olysenko
committed
Merge branch 'develop' into bugfixes
2 parents f350e5d + 471976c commit 13174eb

File tree

5 files changed

+42
-11
lines changed

5 files changed

+42
-11
lines changed

app/code/Magento/PageCache/view/frontend/web/js/page-cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ define([
3737
case 9: // DOCUMENT_NODE
3838
var hostName = window.location.hostname,
3939
iFrameHostName = $('<a>')
40-
.prop('href', element.prop('src'))
40+
.prop('href', $(element).prop('src'))
4141
.prop('hostname');
4242

4343
if (hostName === iFrameHostName) {

app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ define([
1616
defaults: {
1717
elementSelector: 'textarea',
1818
value: '',
19+
$wysiwygEditorButton: '',
1920
links: {
2021
value: '${ $.provider }:${ $.dataScope }'
2122
},
2223
template: 'ui/form/field',
2324
elementTmpl: 'ui/form/element/wysiwyg',
2425
content: '',
2526
showSpinner: false,
26-
loading: false
27+
loading: false,
28+
listens: {
29+
disabled: 'setDisabled'
30+
}
2731
},
2832

2933
/**
@@ -34,6 +38,13 @@ define([
3438
this._super()
3539
.initNodeListener();
3640

41+
$.async({
42+
component: this,
43+
selector: 'button'
44+
}, function (element) {
45+
this.$wysiwygEditorButton = $(element);
46+
}.bind(this));
47+
3748
return this;
3849
},
3950

@@ -69,6 +80,26 @@ define([
6980
$(node).bindings({
7081
value: this.value
7182
});
83+
},
84+
85+
/**
86+
* Set disabled property to wysiwyg component
87+
*
88+
* @param {Boolean} status
89+
*/
90+
setDisabled: function (status) {
91+
this.$wysiwygEditorButton.attr('disabled', status);
92+
93+
/* eslint-disable no-undef */
94+
if (tinyMCE) {
95+
_.each(tinyMCE.activeEditor.controlManager.controls, function (property, index, controls) {
96+
controls[property].setDisabled(status);
97+
});
98+
99+
tinyMCE.activeEditor.getBody().setAttribute('contenteditable', !status);
100+
}
101+
102+
/* eslint-enable no-undef*/
72103
}
73104
});
74105
});

app/code/Magento/Ui/view/base/web/js/grid/resize.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,10 @@ define([
261261
*/
262262
initResizableElement: function (column) {
263263
var model = ko.dataFor(column),
264-
ctx = ko.contextFor(column),
265-
tempalteDragElement = '<div class="' + ctx.$parent.resizeConfig.classResize + '"></div>';
264+
templateDragElement = '<div class="' + this.resizableElementClass + '"></div>';
266265

267266
if (_.isUndefined(model.resizeEnabled) || model.resizeEnabled) {
268-
$(column).append(tempalteDragElement);
267+
$(column).append(templateDragElement);
269268

270269
return true;
271270
}

lib/web/mage/apply/scripts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ define([
8888

8989
/**
9090
* Parses 'script' tags with a custom type attribute and moves it's data
91-
* to a 'data-mage-init' attribute of an elemennt found by provided selector.
91+
* to a 'data-mage-init' attribute of an element found by provided selector.
9292
* Note: All found script nodes will be removed from DOM.
9393
*
9494
* @returns {Array} An array of components not assigned to the specific element.

lib/web/mage/menu.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ define([
8686
//Add class for expanded option
8787
isExpanded: function () {
8888
var subMenus = this.element.find(this.options.menus),
89-
expandedMenus = subMenus.find('ul');
89+
expandedMenus = subMenus.find(this.options.menus);
9090

9191
expandedMenus.addClass('expanded');
9292
},
@@ -105,7 +105,7 @@ define([
105105
return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
106106
}
107107

108-
if (this.active.closest('ul').attr('aria-expanded') != 'true') {
108+
if (this.active.closest(this.options.menus).attr('aria-expanded') != 'true') {
109109

110110
switch (event.keyCode) {
111111
case $.ui.keyCode.PAGE_UP:
@@ -334,15 +334,16 @@ define([
334334
},
335335
"mouseenter .ui-menu-item": function (event) {
336336
var target = $(event.currentTarget),
337+
submenu = this.options.menus,
337338
ulElement,
338339
ulElementWidth,
339340
width,
340341
targetPageX,
341342
rightBound;
342343

343-
if (target.has('ul')) {
344-
ulElement = target.find('ul');
345-
ulElementWidth = target.find('ul').outerWidth(true);
344+
if (target.has(submenu)) {
345+
ulElement = target.find(submenu);
346+
ulElementWidth = ulElement.outerWidth(true);
346347
width = target.outerWidth() * 2;
347348
targetPageX = target.offset().left;
348349
rightBound = $(window).width();

0 commit comments

Comments
 (0)