Skip to content

Commit 18fa7b1

Browse files
author
Lukasz Borowiec
committed
#514: User sees content snapshot on Category Page in Admin Panel - #1 Added a stage to the category page
1 parent aa71a04 commit 18fa7b1

File tree

2 files changed

+4
-41
lines changed

2 files changed

+4
-41
lines changed

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

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ define([
2525
elementSelector: '> textarea',
2626
stageSelector: '.pagebuilder-stage-wrapper',
2727
pageBuilder: false,
28-
visiblePageBuilder: false,
28+
visiblePageBuilder: true,
2929
isComponentInitialized: false,
3030
wysiwygConfigData: {},
3131
pageBuilderEditButtonText: $t('Edit with Page Builder'),
@@ -38,10 +38,7 @@ define([
3838
*/
3939
initialize: function () {
4040
this._super();
41-
42-
if (!this.wysiwygConfigData()['pagebuilder_button']) {
43-
this.initPageBuilder();
44-
}
41+
this.initPageBuilder();
4542

4643
return this;
4744
},
@@ -92,10 +89,6 @@ define([
9289
selector: this.stageSelector
9390
}, this.disableDomObserver.bind(this));
9491
}
95-
96-
if (!this.wysiwygConfigData()['pagebuilder_button']) {
97-
this.visiblePageBuilder(true);
98-
}
9992
},
10093

10194
/**
@@ -165,41 +158,13 @@ define([
165158
});
166159
}.bind(this), 350);
167160
}
168-
169-
if (this.wysiwygConfigData()['pagebuilder_button']) {
170-
// Force full screen mode whilst the animation occurs
171-
this.transitionOut(true);
172-
// Trigger animation out
173-
this.transition(false);
174-
175-
// Reset the transition out class and hide the stage
176-
_.delay(function () {
177-
this.transitionOut(false);
178-
this.visiblePageBuilder(false);
179-
}.bind(this), 185);
180-
}
181161
} else if (args.fullScreen) {
182162
if (this.isWithinModal && this.modal) {
183163
this.modal.css({
184164
transform: 'none',
185165
transition: 'none'
186166
});
187167
}
188-
189-
if (this.wysiwygConfigData()['pagebuilder_button']) {
190-
this.visiblePageBuilder(true);
191-
192-
fullScreenDeferred.resolve();
193-
194-
/* eslint-disable max-depth */
195-
// If the stage has already rendered once we don't need to wait until animating the stage in
196-
if (rendered) {
197-
_.defer(function () {
198-
this.transition(true);
199-
}.bind(this));
200-
}
201-
/* eslint-enable max-depth */
202-
}
203168
}
204169
}.bind(this));
205170

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@
66
-->
77

88
<div visible="visible" css="{'_disabled': disabled}">
9-
<button if="wysiwygConfigData()['pagebuilder_button']"
10-
type="button"
9+
<button type="button"
1110
class="action-default action"
1211
ko-disabled="disabled"
1312
click="pageBuilderEditButtonClick.bind($data)">
1413
<span translate="pageBuilderEditButtonText" />
1514
</button>
1615
<if args="isComponentInitialized">
1716
<div visible="visiblePageBuilder"
18-
class="pagebuilder-wysiwyg-wrapper"
19-
css="{'pagebuilder-transition-in': wysiwygConfigData()['pagebuilder_button'], 'trigger-transition': transition, 'pagebuilder-transition-out': transitionOut}">
17+
class="pagebuilder-wysiwyg-wrapper">
2018
<with args="pageBuilder">
2119
<render />
2220
</with>

0 commit comments

Comments
 (0)