From 1fc5ca641d39ad263c0b4d9fc414bec9d9b13d4d Mon Sep 17 00:00:00 2001 From: Robin Scholtes Date: Tue, 25 Jul 2023 14:54:43 +1200 Subject: [PATCH] add option to c-operation-list to set op-list to isCloneable to recipe --- src/web/components/c-operation-list.mjs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/web/components/c-operation-list.mjs b/src/web/components/c-operation-list.mjs index b6c1f7ca..75245ca5 100644 --- a/src/web/components/c-operation-list.mjs +++ b/src/web/components/c-operation-list.mjs @@ -14,16 +14,19 @@ export class COperationList extends HTMLElement { app, opNames, includeStarIcon, + isSortable = false, + isCloneable = true, icon, - isSortable = false + ) { super(); this.app = app; this.opNames = opNames; this.includeStarIcon = includeStarIcon; - this.icon = icon; this.isSortable = isSortable; + this.isCloneable = isCloneable; + this.icon = icon; } /** @@ -66,10 +69,17 @@ export class COperationList extends HTMLElement { } }.bind(this), }); + } else if (!this.app.isMobileView() && this.isCloneable) { + const cloneableList = Sortable.create(ul, { + group: { + name: "recipe", + pull: "clone", + }, + draggable: "c-operation-li", + sort: false + }) } - ul.dispatchEvent(this.app.manager.oplistcreate); - this.append(ul); } }