Clicky button

This commit is contained in:
Tony Garnock-Jones 2018-11-05 13:58:25 +00:00
parent fa2ee1915d
commit 935ec51dcb
2 changed files with 10 additions and 0 deletions

View File

@ -24,5 +24,6 @@
<p>
Source code: <a href="src/index.js">index.js</a>
</p>
<div id="extra"></div>
</body>
</html>

View File

@ -59,3 +59,12 @@ spawn named 'controller' {
^ SetSortColumn(JSON.parse(e.target.dataset.column));
}
}
spawn named 'alerter' {
let ui = new UI.Anchor();
assert ui.html('#extra', <button>Click me</button>);
on message UI.UIEvent(ui.fragmentId, '.', 'click', $e) {
alert("Hello!");
}
}