mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-24 08:46:20 -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) {
|
||||
const dialogNodes = document.querySelectorAll('x-dialog');
|
||||
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) {
|
||||
if(document.querySelectorAll('x-dialog[show]').length === 0) {
|
||||
// prevent send on paste when dialog is open
|
||||
e.preventDefault()
|
||||
const files = e.clipboardData.files;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue