tree: add "Show in session" context menu action

This commit is contained in:
bordun 2021-04-29 21:03:49 +02:00
parent 9470aba0ec
commit ac2f0d9950
5 changed files with 44 additions and 1 deletions

View file

@ -11,6 +11,7 @@
- editor
- tree: allow specifying multiple type filters
- tree: add "Show in session" context menu action
## 1.9.2

View file

@ -88,12 +88,35 @@ var handleClick = function(event) {
},
shortcut: 't'
})
} else {
actions.push({
separator: true
label: icon('eye') + ' ' + locales('editor_show_in_session'),
action: ()=>{
for (let w of editor.selectedWidgets) {
var parent = w
while (parent !== widgetManager) {
if (parent.getProp('type') === 'tab') parent.parent.setValue(parent.parent.children.indexOf(parent), {sync: true, send: true})
else if (parent.getProp('type') === 'modal') parent.setValue(1, {sync: true, send: true})
parent = parent.parent
}
w.container.classList.add('editor-blink')
w.container.scrollIntoView({block: 'center'})
setTimeout(()=>{
w.container.classList.remove('editor-blink')
}, 800)
}
}
})
}
actions.push({
separator: true
})
actions.push({
label: icon('copy') + ' ' + locales('editor_copy'),
action: editor.copyWidget.bind(editor),

View file

@ -16,6 +16,7 @@ module.exports = {
// editor context-menu
editor_show_in_tree: 'Show in tree',
editor_show_in_session: 'Show in session',
editor_front: 'Bring to front',
editor_closer: 'Bring closer',
editor_back: 'Send to back',

View file

@ -15,6 +15,7 @@ module.exports = {
// editor context-menu
editor_show_in_tree: 'Voir dans l\'arborescence',
editor_show_in_session: 'Voir dans la session',
editor_front: 'Amener devant',
editor_closer: 'Amener plus près',
editor_back: 'Envoyer à l\'arrière',

View file

@ -41,3 +41,20 @@
box-shadow: none!important;
opacity: 1!important;
}
.widget.editing.editor-blink:after,
.modal-container.editing.editor-blink > .popup > .popup-wrapper:after {
display: block!important;
-webkit-mask-image: none;
mask-image: none;
background-color: var(--color-accent);
opacity: 0.5!important;
animation: editor-blink 0.51s steps(3) infinite;
}
@keyframes editor-blink {
from {--color-accent: var(--color-warning)}
to {--color-accent: transparent}
}