From 05854c7ad8595ed5fec15aa72d49e85c0781b67a Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 3 May 2021 09:00:00 +0200 Subject: [PATCH] make tree item blink when hitting "Show in tree" --- CHANGELOG.md | 3 +++ src/client/editor/context-menu.js | 7 +++++++ src/scss/ui/tree.scss | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 095d425b..36c6a4b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ - add `getVar()` and `setVar` for reading and modifying custom variables. This allows modifying properties directly from scripts. - expose session path as `globals.session` +- editor + - make tree item blink when hitting "Show in tree" + ## 1.9.3 - bug fixes diff --git a/src/client/editor/context-menu.js b/src/client/editor/context-menu.js index 8b2156e3..79c7a01c 100644 --- a/src/client/editor/context-menu.js +++ b/src/client/editor/context-menu.js @@ -85,6 +85,13 @@ var handleClick = function(event) { label: icon('project-diagram') + ' ' + locales('editor_show_in_tree'), action: ()=>{ editor.widgetTree.showWidget(editor.selectedWidgets[0]) + DOM.each(editor.widgetTree.list, '.editing', (el)=>{ + el.classList.add('editor-blink') + el.scrollIntoView({block: 'center'}) + setTimeout(()=>{ + el.classList.remove('editor-blink') + }, 800) + }) }, shortcut: 't' }) diff --git a/src/scss/ui/tree.scss b/src/scss/ui/tree.scss index 6f7a9e58..1f215f8d 100644 --- a/src/scss/ui/tree.scss +++ b/src/scss/ui/tree.scss @@ -129,6 +129,13 @@ top: 0; } + &.editor-blink:after { + animation: tree-editor-blink 0.51s steps(3) infinite; + } + @keyframes tree-editor-blink { + from {--color-fill: var(--color-warning)} + to {--color-fill: inherit} + } } .contains-editing:not(.expanded):not(.editing) {