mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-24 00:36:17 -04:00
use document selector to check whether any dialog is opened
This commit is contained in:
parent
10276b472d
commit
9900aaf167
1 changed files with 1 additions and 11 deletions
|
@ -68,17 +68,7 @@ class PeersUI {
|
||||||
}
|
}
|
||||||
|
|
||||||
_onPaste(e) {
|
_onPaste(e) {
|
||||||
const dialogNodes = document.querySelectorAll('x-dialog');
|
if(document.querySelectorAll('x-dialog[show]').length === 0) {
|
||||||
let dialogIsOpen = false
|
|
||||||
dialogNodes.forEach(function (dialogNode) {
|
|
||||||
for(let i=0; i<dialogNode.attributes.length; i++){
|
|
||||||
if (dialogNode.attributes[i].name === "show") {
|
|
||||||
dialogIsOpen = true;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(!dialogIsOpen) {
|
|
||||||
// prevent send on paste when dialog is open
|
// prevent send on paste when dialog is open
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
const files = e.clipboardData.files;
|
const files = e.clipboardData.files;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue