summaryrefslogtreecommitdiff
path: root/tests/dynClass.ur
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dynClass.ur')
-rw-r--r--tests/dynClass.ur21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/dynClass.ur b/tests/dynClass.ur
new file mode 100644
index 00000000..2c7068c8
--- /dev/null
+++ b/tests/dynClass.ur
@@ -0,0 +1,21 @@
+style s1
+style s2
+
+fun main () : transaction page =
+ src <- source s1;
+ s <- source "";
+ toggle <- source False;
+ return <xml>
+ <head>
+ <link rel="stylesheet" type="text/css" href="http://localhost/test.css"/>
+ </head>
+ <body>
+ <button dynClass={signal src} onclick={set src s2}/>
+
+ <hr/>
+
+ <ctextbox source={s} dynClass={t <- signal toggle;
+ return (if t then s1 else s2)}
+ onkeyup={fn _ => t <- get toggle; set toggle (not t)}/>
+ </body>
+ </xml>