Skip to content

Commit

Permalink
Update dialog JavaScript for newer Electron API
Browse files Browse the repository at this point in the history
Differences in the security model of later versions of Electron meant
that a few tweaks were necessary to ensure compatibility with the latest
updates to Blink.jl
  • Loading branch information
mosullivan93 committed May 18, 2023
1 parent 190d691 commit 3e755dd
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/input.jl
Expand Up @@ -97,17 +97,12 @@ function dialog(theme::WidgetTheme, dialogtype; value, className = "", label = "
setobservable!(scp, "output", value)
clicks = Observable(scp, "clicks", 0)
callback = @js function (val)
$value[] = val
console.log(val);
$value[] = val;
end
onimport(scp, js"""
function () {
const { dialog } = require('electron').remote;
this.dialog = dialog;
}
""")
onjs(clicks, js"""
function (val) {
console.log(this.dialog.$dialogtype($options, $callback));
window.dialog.$dialogtype($options, $callback);
}
""")
className = mergeclasses(getclass(theme, :button), className)
Expand Down

0 comments on commit 3e755dd

Please sign in to comment.