From ec45d95244b6051c291dad88799ebb9532c88e96 Mon Sep 17 00:00:00 2001 From: Robin Scholtes Date: Mon, 24 Apr 2023 22:55:55 +1200 Subject: [PATCH] [#181] add 'selected' class on double click, which is not visible on desktop ( but we can easily opt to leave it there if we would want to ) --- src/web/stylesheets/components/_operation.css | 14 ++++++++++++++ src/web/waiters/OperationsWaiter.mjs | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/web/stylesheets/components/_operation.css b/src/web/stylesheets/components/_operation.css index 06c9d1a1..b9b5434d 100755 --- a/src/web/stylesheets/components/_operation.css +++ b/src/web/stylesheets/components/_operation.css @@ -21,6 +21,11 @@ .operation { cursor: grab; } + + /* never display check icons on desktop views */ + .op-icon.check-icon { + display: none; + } } .op-icon { @@ -33,6 +38,15 @@ color: #f44336; } +.op-icon.check-icon { + display: none; + color: #47d047; +} + +.operation.selected > .op-icon.check-icon { + display: initial; +} + .op-title { font-weight: var(--op-title-font-weight); } diff --git a/src/web/waiters/OperationsWaiter.mjs b/src/web/waiters/OperationsWaiter.mjs index b239473a..e9f6c2a5 100755 --- a/src/web/waiters/OperationsWaiter.mjs +++ b/src/web/waiters/OperationsWaiter.mjs @@ -244,6 +244,8 @@ class OperationsWaiter { operationDblclick(e) { const li = e.target; + e.target.classList.add('selected'); + this.manager.recipe.addOperation(li.getAttribute('data-name')); }