PageRenderTime 91ms CodeModel.GetById 40ms app.highlight 2ms RepoModel.GetById 33ms app.codeStats 1ms

/pyjs/tests/test013.js

http://pyjamas.googlecode.com/
JavaScript | 30 lines | 25 code | 5 blank | 0 comment | 5 complexity | 36456792e605ffe91c8eb62844ce1f06 MD5 | raw file
 1__ui_FocusWidget.prototype.__class__ = "ui_FocusWidget";
 2function ui_FocusWidget(element) {
 3    return new __ui_FocusWidget(element);
 4}
 5function __ui_FocusWidget(element) {
 6    this.clickListeners = new pyjslib_List([]);
 7}
 8__ui_FocusWidget.prototype.addClickListener = function(listener) {
 9    this.clickListeners.append(listener);
10};
11__ui_FocusWidget.prototype.onBrowserEvent = function(event) {
12    if ((DOM_eventGetType(event) == __ui_Event.ONCLICK)) {
13
14        var __listener = this.clickListeners.__iter__();
15        try {
16            while (true) {
17                var listener = __listener.next();
18                
19        
20    listener(this);
21
22            }
23        } catch (e) {
24            if (e != StopIteration) {
25                throw e;
26            }
27        }
28        
29    }
30};