Skip to content

Commit e55ad1e

Browse files
committed
MC-3653: Can Drag & Drop Child Content Types Into Hidden Content Types
- Resolve issue with dragging content types into same position causing them to be removed
1 parent 3689141 commit e55ad1e

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type-menu/hide-show-option.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-menu/hide-show-option.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export default class HideShowOption extends Option implements OptionInterface {
4242
this.icon(HideShowOption.hideIcon);
4343
this.title(HideShowOption.hideText);
4444
} else {
45-
this.icon(HideShowOption.showText);
46-
this.title(HideShowOption.showIcon);
45+
this.icon(HideShowOption.showIcon);
46+
this.title(HideShowOption.showText);
4747
}
4848
}
4949
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ function onSort(preview: Preview, event: Event, ui: JQueryUI.SortableUIParams) {
159159
* On sort stop hide any indicators
160160
*/
161161
function onSortStop(preview: Preview, event: Event, ui: JQueryUI.SortableUIParams) {
162-
sortedContentType = null;
163162
ui.item.removeClass("pagebuilder-sorting-original");
164163
hideDropIndicators();
165164
setDraggedContentTypeConfig(null);
@@ -169,9 +168,11 @@ function onSortStop(preview: Preview, event: Event, ui: JQueryUI.SortableUIParam
169168
events.trigger("stage:interactionStop");
170169
}
171170

172-
if (ui.item) {
171+
if (ui.item && sortedContentType === null) {
173172
ui.item.remove();
174173
}
174+
175+
sortedContentType = null;
175176
}
176177

177178
/**

0 commit comments

Comments
 (0)