Commit 26c44f4c authored by Jörg Richter's avatar Jörg Richter

Try prevent default contextmenu, pt.5 (#295)

parent 2f22a7a4
Pipeline #8154 passed with stages
in 5 minutes and 27 seconds
......@@ -82,10 +82,10 @@ Promise.all([
document.body.addEventListener('contextmenu', e => {
console.log('body', e.target.tagName, e.target.classList, e.target.parentNode.classList)
const inSearchDialog = e.target.parentNode.classList.contains('el-dialog')
const inMessageBox = e.target.parentNode.classList.contains('el-message-box')
const inMessageBoxWrapper = e.target.classList.contains('el-message-box__wrapper')
console.log(inSearchDialog, inMessageBox, inMessageBoxWrapper)
if (inSearchDialog || inMessageBox || inMessageBoxWrapper) {
const messageBoxWrapper = document.querySelector('.el-message-box__wrapper')
const inMessageBox = messageBoxWrapper && messageBoxWrapper.contains(e.target)
console.log(inSearchDialog, inMessageBox)
if (inSearchDialog || inMessageBox) {
e.preventDefault()
}
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment