editor: bypass kb shortcuts when help modal is opened (to allow text copy)

This commit is contained in:
bordun 2020-05-17 18:56:01 +02:00
parent be88d446b9
commit f13e501264
2 changed files with 10 additions and 2 deletions

View file

@ -169,7 +169,7 @@ class Editor {
handleKeyboard(combo, e){
if (e.target && (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.tagName === 'SELECT')) return
if (this.inspector.helpModalOpened || e.target && (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.tagName === 'SELECT')) return
e.preventDefault()

View file

@ -85,6 +85,8 @@ class UiInspector extends UiWidget {
this.lock = false
this.clearTimeout = null
this.helpModalOpened = false
}
clear() {
@ -269,7 +271,7 @@ class UiInspector extends UiWidget {
computedValue = JSON.stringify(computedValue, null, ' ')
}
new UiModal({closable: true, title: html`<span class="editor-help-title">${name}</span>`, html: true, content: html`
var modal = new UiModal({closable: true, title: html`<span class="editor-help-title">${name}</span>`, html: true, content: html`
<div class="inspector-help">
<div class="header">
@ -291,6 +293,12 @@ class UiInspector extends UiWidget {
</div>
`})
this.helpModalOpened = true
modal.on('close', ()=>{
this.helpModalOpened = false
})
}
}