Skip to content

Commit 3e755dd

Browse files
committed
Update dialog JavaScript for newer Electron API
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
1 parent 190d691 commit 3e755dd

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/input.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,12 @@ function dialog(theme::WidgetTheme, dialogtype; value, className = "", label = "
9797
setobservable!(scp, "output", value)
9898
clicks = Observable(scp, "clicks", 0)
9999
callback = @js function (val)
100-
$value[] = val
100+
console.log(val);
101+
$value[] = val;
101102
end
102-
onimport(scp, js"""
103-
function () {
104-
const { dialog } = require('electron').remote;
105-
this.dialog = dialog;
106-
}
107-
""")
108103
onjs(clicks, js"""
109104
function (val) {
110-
console.log(this.dialog.$dialogtype($options, $callback));
105+
window.dialog.$dialogtype($options, $callback);
111106
}
112107
""")
113108
className = mergeclasses(getclass(theme, :button), className)

0 commit comments

Comments
 (0)