diff options
author | Chelsea Voss <csvoss@mit.edu> | 2016-11-05 16:57:12 -0400 |
---|---|---|
committer | Chelsea Voss <csvoss@mit.edu> | 2016-11-05 17:00:25 -0400 |
commit | 01a1780abc65db235dbef39f8dd0cd44d400aebe (patch) | |
tree | 8b03e02b7fa1d75114ccffd1455bddd356f314a7 /mdl/mdlFfi.js | |
parent | 9e4a75fe23afd82dd4556c73be654366f47bad00 (diff) |
Create browser history FFI module; make x button in new actions go back
Diffstat (limited to 'mdl/mdlFfi.js')
-rw-r--r-- | mdl/mdlFfi.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mdl/mdlFfi.js b/mdl/mdlFfi.js index f961cab..97c4166 100644 --- a/mdl/mdlFfi.js +++ b/mdl/mdlFfi.js @@ -1,5 +1,6 @@ // Copyright 2015 Google Inc. // Copyright 2016 Benjamin Barenblat +// Copyright 2016 Chelsea Voss // // Licensed under the Apache License, Version 2.0 (the “License”); you may not // use this file except in compliance with the License. You may obtain a copy @@ -15,14 +16,20 @@ "use strict"; -var UrWeb = { - MdlFfi: { - +(function() { + var mdlFfi = { showSnackbar: function(id, text) { document.querySelector('#' + id) .MaterialSnackbar.showSnackbar({message: text}); }, + }; + try { + UrWeb.MdlFfi = mdlFfi; + } catch (ReferenceError) { + console.log("asdf"); + window.UrWeb = {MdlFfi: mdlFfi}; + console.log("hjkl"); } -}; // UrWeb.MdlFfi +})(); // UrWeb.MdlFfi |