javascript - Enyo onbeforeunload Event -


i'm trying attach listener onbeforeunload in app doesn't seem caught enyo.signals.

according documentation:

within enyo framework itself, dom events have no node targets broadcast signals. these events include window events, onload , onbeforeunload, , events occur directly on document, onkeypress if document has focus. signals useful hooking non-enyo events (e.g., phonegap events) handled enyo kinds in application code.

i wrote following test case:

 enyo.kind({     name: "app",     kind: "enyo.control",     fit: true,     content: "hello world",      components:[         {kind: "enyo.signals", onbeforeunload: "test"}     ],      test: function(insender, inevent) {          return 'you have unsaved changes!';     } }); 

this seems have no effect when close tab or navigate away page. missing? here jsfiddle

it doesn't handling beforeunload default:

https://github.com/enyojs/enyo/blob/master/source/dom/dispatcher.js

but, can work like

enyo.dispatcher.listen(window, "beforeunload"); 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -