From 01a1780abc65db235dbef39f8dd0cd44d400aebe Mon Sep 17 00:00:00 2001 From: Chelsea Voss Date: Sat, 5 Nov 2016 16:57:12 -0400 Subject: Create browser history FFI module; make x button in new actions go back --- mdl/mdlFfi.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'mdl/mdlFfi.js') 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 -- cgit v1.2.3