summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chelsea Voss <csvoss@mit.edu>2016-11-05 16:41:08 -0400
committerGravatar Chelsea Voss <csvoss@mit.edu>2016-11-05 17:00:49 -0400
commitb0357cefdbcf4d8c3b4323f8d34f08257d6bf88b (patch)
tree0b05cad59ee2084628c57928c6601434710ff581
parent01a1780abc65db235dbef39f8dd0cd44d400aebe (diff)
Revert x button behavior when accessed through Next ActionsHEADmaster
Also create New Action page at /new, whose x button accesses the browser history.
-rw-r--r--main.ur15
1 files changed, 9 insertions, 6 deletions
diff --git a/main.ur b/main.ur
index 0620419..8231762 100644
--- a/main.ur
+++ b/main.ur
@@ -64,12 +64,12 @@ style visible
datatype mode = NextActions | NewNextAction
-val newActionsDiv actionItems =
+val makeNewActionsDiv goBackAction actionItems =
newNextActionDescription <- Mdl.Textbox.make "Description";
return <xml>
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
- <button class="mdl-layout__drawer-button" onclick={fn _ => History.browserBack}>
+ <button class="mdl-layout__drawer-button" onclick={fn _ => goBackAction}>
<i class="material-icons">close</i>
</button>
<div class="mdl-layout__header-row">
@@ -79,7 +79,7 @@ val newActionsDiv actionItems =
name <- get newNextActionDescription.Source;
bind (rpc (newNextAction name)) (set actionItems);
sleep 0;
- (* TODO(csvoss): Put the right back action here. *)
+ goBackAction;
set newNextActionDescription.Source ""
} />
</div>
@@ -90,12 +90,15 @@ val newActionsDiv actionItems =
</div>
</xml>
-val new = return <xml><head></head><body>Hello, world!</body></xml>
+val new =
+ actionItems <- bind renderNextActions source;
+ newActionsDiv <- makeNewActionsDiv History.browserBack actionItems;
+ return <xml><body>{newActionsDiv}</body></xml>
val main =
actionItems <- bind renderNextActions source;
mode <- source NextActions;
- newActionsDivValue <- newActionsDiv actionItems;
+ newActionsDiv <- makeNewActionsDiv (set mode NextActions) actionItems;
return <xml>
<head>
(* TODO(bbaren): Write a meta-description tag. *)
@@ -125,7 +128,7 @@ val main =
NewNextAction => visible
| _ => hidden)
}>
- {newActionsDivValue}
+ {newActionsDiv}
</div>
<div dynClass={
currentMode <- signal mode;