mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
js: DOM API. Part 1 (#12296)
This commit is contained in:
15
vlib/jsdom/window.js.v
Normal file
15
vlib/jsdom/window.js.v
Normal file
@ -0,0 +1,15 @@
|
||||
module jsdom
|
||||
|
||||
pub struct JS.Window {
|
||||
}
|
||||
|
||||
pub struct Window {
|
||||
node JS.Window [noinit]
|
||||
}
|
||||
|
||||
pub fn (elem Window) add_event_listener(event string, cb EventCallback) {
|
||||
#elem.node.addEventListener(event.str, function (event) { let e = jsdom__dispatch_event_target(this);
|
||||
#let ev = jsdom__dispatch_event(event); ev.event = event;
|
||||
#return cb(e,ev)
|
||||
#});
|
||||
}
|
Reference in New Issue
Block a user