diff --git a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js index 8076048a50208..ce93351386183 100644 --- a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js +++ b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js @@ -37,7 +37,7 @@ define([ case 9: // DOCUMENT_NODE var hostName = window.location.hostname, iFrameHostName = $('') - .prop('href', element.prop('src')) + .prop('href', $(element).prop('src')) .prop('hostname'); if (hostName === iFrameHostName) { diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js b/app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js index b3db5d11b98a5..01c8ef29029a9 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js @@ -16,6 +16,7 @@ define([ defaults: { elementSelector: 'textarea', value: '', + $wysiwygEditorButton: '', links: { value: '${ $.provider }:${ $.dataScope }' }, @@ -23,7 +24,10 @@ define([ elementTmpl: 'ui/form/element/wysiwyg', content: '', showSpinner: false, - loading: false + loading: false, + listens: { + disabled: 'setDisabled' + } }, /** @@ -34,6 +38,13 @@ define([ this._super() .initNodeListener(); + $.async({ + component: this, + selector: 'button' + }, function (element) { + this.$wysiwygEditorButton = $(element); + }.bind(this)); + return this; }, @@ -69,6 +80,26 @@ define([ $(node).bindings({ value: this.value }); + }, + + /** + * Set disabled property to wysiwyg component + * + * @param {Boolean} status + */ + setDisabled: function (status) { + this.$wysiwygEditorButton.attr('disabled', status); + + /* eslint-disable no-undef */ + if (tinyMCE) { + _.each(tinyMCE.activeEditor.controlManager.controls, function (property, index, controls) { + controls[property].setDisabled(status); + }); + + tinyMCE.activeEditor.getBody().setAttribute('contenteditable', !status); + } + + /* eslint-enable no-undef*/ } }); }); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/resize.js b/app/code/Magento/Ui/view/base/web/js/grid/resize.js index bad2061ec7635..f7edde0ea47c4 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/resize.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/resize.js @@ -261,11 +261,10 @@ define([ */ initResizableElement: function (column) { var model = ko.dataFor(column), - ctx = ko.contextFor(column), - tempalteDragElement = '
'; + templateDragElement = '
'; if (_.isUndefined(model.resizeEnabled) || model.resizeEnabled) { - $(column).append(tempalteDragElement); + $(column).append(templateDragElement); return true; } diff --git a/lib/web/mage/apply/scripts.js b/lib/web/mage/apply/scripts.js index 7f059a45ae5cd..3b87f4fd2f40e 100644 --- a/lib/web/mage/apply/scripts.js +++ b/lib/web/mage/apply/scripts.js @@ -88,7 +88,7 @@ define([ /** * Parses 'script' tags with a custom type attribute and moves it's data - * to a 'data-mage-init' attribute of an elemennt found by provided selector. + * to a 'data-mage-init' attribute of an element found by provided selector. * Note: All found script nodes will be removed from DOM. * * @returns {Array} An array of components not assigned to the specific element. diff --git a/lib/web/mage/menu.js b/lib/web/mage/menu.js index a3f4ad36d0afa..3bed3dd4efcc7 100644 --- a/lib/web/mage/menu.js +++ b/lib/web/mage/menu.js @@ -86,7 +86,7 @@ define([ //Add class for expanded option isExpanded: function () { var subMenus = this.element.find(this.options.menus), - expandedMenus = subMenus.find('ul'); + expandedMenus = subMenus.find(this.options.menus); expandedMenus.addClass('expanded'); }, @@ -105,7 +105,7 @@ define([ return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); } - if (this.active.closest('ul').attr('aria-expanded') != 'true') { + if (this.active.closest(this.options.menus).attr('aria-expanded') != 'true') { switch (event.keyCode) { case $.ui.keyCode.PAGE_UP: @@ -334,15 +334,16 @@ define([ }, "mouseenter .ui-menu-item": function (event) { var target = $(event.currentTarget), + submenu = this.options.menus, ulElement, ulElementWidth, width, targetPageX, rightBound; - if (target.has('ul')) { - ulElement = target.find('ul'); - ulElementWidth = target.find('ul').outerWidth(true); + if (target.has(submenu)) { + ulElement = target.find(submenu); + ulElementWidth = ulElement.outerWidth(true); width = target.outerWidth() * 2; targetPageX = target.offset().left; rightBound = $(window).width();