Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions nested/dialog-window.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<style>
body {
color: #FFFFFF;
/* background-color: rgba(255, 255, 255, 0.1); */
}

h5 {
Expand Down Expand Up @@ -60,10 +61,12 @@ <h5>Are you sure to delete the screen shot</h3>

const window = WebviewWindow.getByLabel('main')
const dialogWindow = getCurrent()
const dialogWindow2 = WebviewWindow.getByLabel('dialog'); // reference to the WebviewWindow with the label 'dialog' to set decoration to false again.
document.getElementById('yes').addEventListener('click', async function () {
try {
await window.emit(EVENT.PERMISSION, { 'permission': true })
await dialogWindow.hide()
await dialogWindow2.setDecorations(false) // setting Decoration to false if user iterect with yes.
} catch (e) {
console.log('error while emitting', e);
}
Expand All @@ -73,6 +76,7 @@ <h5>Are you sure to delete the screen shot</h3>
try {
await window.emit(EVENT.PERMISSION, { 'permission': false })
await dialogWindow.hide()
await dialogWindow2.setDecorations(false) // setting Decoration to false if user iterect with no.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

} catch (e) {
console.log('error while emitting', e);
}
Expand All @@ -81,6 +85,7 @@ <h5>Are you sure to delete the screen shot</h3>
dialogWindow.onCloseRequested(async (event) => {
await window.emit(EVENT.PERMISSION, { 'permission': false });
await dialogWindow.hide();
await dialogWindow2.setDecorations(false) // setting Decoration to false if user iterect with no if user close the dialog.
event.stopPropogation();
})

Expand Down
Loading