summaryrefslogtreecommitdiff
path: root/mdl/mdl.ur
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <benjamin@barenblat.name>2016-08-19 18:59:06 -0400
committerGravatar Benjamin Barenblat <benjamin@barenblat.name>2016-08-19 18:59:06 -0400
commitf9b17a6d6c6e69ab6f5a28747d21ba24d602cfce (patch)
treeb8d5fcd798c6ff28308ecb02135397acf2f92615 /mdl/mdl.ur
parent9a1db8ef5d2d8c791ea499fae5a57f29416a3bcc (diff)
Support MDL toasts
Diffstat (limited to 'mdl/mdl.ur')
-rw-r--r--mdl/mdl.ur16
1 files changed, 16 insertions, 0 deletions
diff --git a/mdl/mdl.ur b/mdl/mdl.ur
index f3dec74..7900822 100644
--- a/mdl/mdl.ur
+++ b/mdl/mdl.ur
@@ -13,3 +13,19 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License. *)
structure Classes = MdlClasses
+open Classes
+
+structure Toast = struct
+ val make : transaction {Placeholder: xbody,
+ Show: string -> transaction unit} =
+ id <- fresh;
+ return {
+ Placeholder = <xml>
+ <div id={id} class="mdl-js-snackbar mdl-snackbar">
+ <div class="mdl-snackbar__text" />
+ <button class="mdl-snackbar__action"></button>
+ </div>
+ </xml>,
+ Show = MdlFfi.showSnackbar (show id)
+ }
+end