Skip to content

Commit 560ebc9

Browse files
committed
MC-4014: PageBuilder Performance Is Bad With Minimal Content
- Resolve issue with hovering over content types
1 parent 0d9be3d commit 560ebc9

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/preview.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/drag-drop/sortable.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/preview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,12 @@ export default class Preview {
205205
* @param {Event} event
206206
*/
207207
public onMouseOut(context: Preview, event: Event) {
208+
this.mouseover = false;
209+
208210
if (getDraggedContentTypeConfig()) {
209211
return;
210212
}
211213

212-
this.mouseover = false;
213214
_.delay(() => {
214215
if (!this.mouseover && this.mouseoverContext === context) {
215216
const currentTarget = event.currentTarget;

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/drag-drop/sortable.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ function onSortStop(preview: Preview, event: Event, ui: JQueryUI.SortableUIParam
184184
* @param {JQueryUI.SortableUIParams} ui
185185
*/
186186
function onSortReceive(preview: Preview, event: Event, ui: JQueryUI.SortableUIParams) {
187+
const contentTypeConfig = getDraggedContentTypeConfig();
188+
setDraggedContentTypeConfig(null);
189+
187190
if ($(event.target)[0] !== this) {
188191
return;
189192
}
@@ -194,7 +197,6 @@ function onSortReceive(preview: Preview, event: Event, ui: JQueryUI.SortableUIPa
194197
return;
195198
}
196199

197-
const contentTypeConfig = getDraggedContentTypeConfig();
198200
if (contentTypeConfig) {
199201
// If the sortable instance is disabled don't complete this operation
200202
if ($(this).sortable("option", "disabled") || $(this).parents(hiddenClass).length > 0) {

0 commit comments

Comments
 (0)