diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenserver/frontend/html/zen.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/zenserver/frontend/html/zen.js b/src/zenserver/frontend/html/zen.js index 177cbd299..33bf18c2b 100644 --- a/src/zenserver/frontend/html/zen.js +++ b/src/zenserver/frontend/html/zen.js @@ -92,6 +92,12 @@ class Component this._element.addEventListener(what, thunk); return this; } + + on_click(func) + { + this.classify("zen_action"); + return this.on("click", func); + } } @@ -462,7 +468,7 @@ class Project extends Page }); cell = cells.at(-1); - cell.attr("zen_param", name).on("click", (e) => this._on_drop(e)); + cell.attr("zen_param", name).on_click((e) => this._on_drop(e)); } // files @@ -574,7 +580,7 @@ class Test extends Page misc_section.tag().text("just text"); misc_section.tag().text("this is a link").link(); // misc_section.tag().text("on() test").on("click", (e) => { alert(this); }).link(); - misc_section.tag().text("MODAL DIALOG").classify("zen_action").on("click", (e) => { + misc_section.tag().text("MODAL DIALOG").on_click((e) => { new Modal() .title("modal") .message("here is a message what I wrote") |