diff --git a/src/block_manager/view/BlockView.ts b/src/block_manager/view/BlockView.ts index d76edf4de..3e8be8ee8 100644 --- a/src/block_manager/view/BlockView.ts +++ b/src/block_manager/view/BlockView.ts @@ -152,6 +152,7 @@ export default class BlockView extends View { `; el.title = attr.title || el.textContent?.trim(); el.setAttribute('draggable', `${hasDnd(em) && !disable ? true : false}`); + // @ts-ignore const result = render && render({ el, model, className, prefix: ppfx }); if (result) el.innerHTML = result; return this; diff --git a/src/block_manager/view/BlocksView.ts b/src/block_manager/view/BlocksView.ts index 79eb82afa..513b0bc3b 100644 --- a/src/block_manager/view/BlocksView.ts +++ b/src/block_manager/view/BlocksView.ts @@ -73,6 +73,7 @@ export default class BlocksView extends View { const canvas = em.Canvas; this.sorter = new utils.Sorter({ + // @ts-ignore container: canvas.getBody(), placer: canvas.getPlacerEl(), containerSel: '*', diff --git a/src/commands/view/SelectPosition.ts b/src/commands/view/SelectPosition.ts index b96f921f8..387c2a799 100644 --- a/src/commands/view/SelectPosition.ts +++ b/src/commands/view/SelectPosition.ts @@ -15,6 +15,7 @@ export default { if (utils && !this.sorter) this.sorter = new utils.Sorter({ + // @ts-ignore container, placer: this.canvas.getPlacerEl(), containerSel: '*', diff --git a/src/navigator/view/ItemsView.ts b/src/navigator/view/ItemsView.ts index a240d7a38..8fcd08393 100644 --- a/src/navigator/view/ItemsView.ts +++ b/src/navigator/view/ItemsView.ts @@ -28,6 +28,7 @@ export default class ItemsView extends View { if (config.sortable && !this.opt.sorter) { const utils = em.Utils; this.opt.sorter = new utils.Sorter({ + // @ts-ignore container: config.sortContainer || this.el, containerSel: `.${this.className}`, itemSel: `.${pfx}layer`, diff --git a/src/style_manager/view/LayersView.ts b/src/style_manager/view/LayersView.ts index bdca5acbf..e3c03ae5f 100644 --- a/src/style_manager/view/LayersView.ts +++ b/src/style_manager/view/LayersView.ts @@ -32,6 +32,7 @@ export default class LayersView extends View { const utils = em?.Utils; this.sorter = utils ? new utils.Sorter({ + // @ts-ignore container: this.el, ignoreViewChildren: 1, containerSel: `.${pfx}layers`, diff --git a/src/utils/Droppable.ts b/src/utils/Droppable.ts index abaa8a2fc..daed3c0ca 100644 --- a/src/utils/Droppable.ts +++ b/src/utils/Droppable.ts @@ -143,6 +143,7 @@ export default class Droppable { dragContent = (cnt: any) => (content = cnt); } else { const sorter = new utils.Sorter({ + // @ts-ignore em, wmargin: 1, nested: 1, @@ -161,7 +162,7 @@ export default class Droppable { sorter.startSort(); this.sorter = sorter; dragStop = (cancel?: boolean) => { - cancel && (sorter.moved = 0); + cancel && (sorter.moved = false); sorter.endMove(); }; dragContent = (content: any) => sorter.setDropContent(content); diff --git a/src/utils/Sorter.ts b/src/utils/Sorter.ts index e33a8771a..011388887 100644 --- a/src/utils/Sorter.ts +++ b/src/utils/Sorter.ts @@ -373,7 +373,7 @@ export default class Sorter extends View { * Picking component to move * @param {HTMLElement} src * */ - startSort(src: HTMLElement, opts: { container?: HTMLElement } = {}) { + startSort(src?: HTMLElement, opts: { container?: HTMLElement } = {}) { const { em, itemSel, containerSel, plh } = this; const container = this.getContainerEl(opts.container); const docs = this.getDocuments(src);