Skip to content

Commit b3df4d6

Browse files
committed
MC-5423: Scheduled Update slide out issues
- Fix scheduled update full screen mode
1 parent 9dd3694 commit b3df4d6

File tree

1 file changed

+36
-25
lines changed
  • app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element

1 file changed

+36
-25
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element/wysiwyg.js

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,9 @@ define([
6161
* Handle button click, init the Page Builder application
6262
*/
6363
pageBuilderEditButtonClick: function (context, event) {
64-
var modalInnerWrap = $(event.currentTarget).parents('.modal-inner-wrap');
65-
64+
this.determineIfWithinModal(event.currentTarget);
6665
this.transition(false);
6766

68-
// Determine if the Page Builder instance is within a modal
69-
this.isWithinModal = modalInnerWrap.length === 1;
70-
71-
if (this.isWithinModal) {
72-
this.modal = modalInnerWrap;
73-
}
74-
7567
if (!this.isComponentInitialized()) {
7668
this.disableDomObserver($(event.currentTarget).parent()[0]);
7769
}
@@ -108,9 +100,26 @@ define([
108100
* @param {HTMLElement} node
109101
*/
110102
disableDomObserver: function (node) {
103+
this.determineIfWithinModal(node);
111104
domObserver.disableNode(node);
112105
},
113106

107+
/**
108+
* Determine if the current instance is within a modal
109+
*
110+
* @param {HTMLElement} element
111+
*/
112+
determineIfWithinModal: function (element) {
113+
var modalInnerWrap = $(element).parents('.modal-inner-wrap');
114+
115+
// Determine if the Page Builder instance is within a modal
116+
this.isWithinModal = modalInnerWrap.length === 1;
117+
118+
if (this.isWithinModal) {
119+
this.modal = modalInnerWrap;
120+
}
121+
},
122+
114123
/**
115124
* Toggle Page Builder full screen mode
116125
*/
@@ -141,14 +150,14 @@ define([
141150
}.bind(this));
142151

143152
events.on('stage:' + id + ':fullScreenModeChangeAfter', function (args) {
144-
if (!args.fullScreen && this.wysiwygConfigData()['pagebuilder_button']) {
145-
if (this.isWithinModal && this.modal) {
146-
this.modal.css({
147-
transform: '',
148-
transition: ''
149-
});
150-
}
153+
if (this.isWithinModal && this.modal) {
154+
this.modal.css({
155+
transform: '',
156+
transition: ''
157+
});
158+
}
151159

160+
if (!args.fullScreen && this.wysiwygConfigData()['pagebuilder_button']) {
152161
// Force full screen mode whilst the animation occurs
153162
this.transitionOut(true);
154163
// Trigger animation out
@@ -159,23 +168,25 @@ define([
159168
this.transitionOut(false);
160169
this.visiblePageBuilder(false);
161170
}.bind(this), 185);
162-
} else if (args.fullScreen && this.wysiwygConfigData()['pagebuilder_button']) {
163-
this.visiblePageBuilder(true);
164-
171+
} else if (args.fullScreen) {
165172
if (this.isWithinModal && this.modal) {
166173
this.modal.css({
167174
transform: 'none',
168175
transition: 'none'
169176
});
170177
}
171178

172-
fullScreenDeferred.resolve();
179+
if (this.wysiwygConfigData()['pagebuilder_button']) {
180+
this.visiblePageBuilder(true);
181+
182+
fullScreenDeferred.resolve();
173183

174-
// If the stage has already rendered once we don't need to wait until animating the stage in
175-
if (rendered) {
176-
_.defer(function () {
177-
this.transition(true);
178-
}.bind(this));
184+
// If the stage has already rendered once we don't need to wait until animating the stage in
185+
if (rendered) {
186+
_.defer(function () {
187+
this.transition(true);
188+
}.bind(this));
189+
}
179190
}
180191
}
181192
}.bind(this));

0 commit comments

Comments
 (0)