From a1fbe0b115fd9f9b654dae79f266581c32ba00d2 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 20 Jan 2016 23:51:37 +0100 Subject: backup db, handle being offline better --- StoneIsland/www/js/lib/products/ClosedStoreView.js | 12 ++++++++++-- StoneIsland/www/js/lib/products/CollectionView.js | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'StoneIsland/www/js/lib/products') diff --git a/StoneIsland/www/js/lib/products/ClosedStoreView.js b/StoneIsland/www/js/lib/products/ClosedStoreView.js index 2f242ba4..97b46006 100755 --- a/StoneIsland/www/js/lib/products/ClosedStoreView.js +++ b/StoneIsland/www/js/lib/products/ClosedStoreView.js @@ -19,12 +19,20 @@ var ClosedStoreView = View.extend({ }, show: function(){ + this.setMessage(app.closed.storeClosedMessageOne, app.closed.storeClosedMessageTwo) + this.showElement() + }, + + showElement: function(){ document.body.className = "closed" this.animate() app.footer.hide() - $(".closed_store_msg h3").html(app.closed.storeClosedMessageOne || "THIS STORE IS CURRENTLY CLOSED") + }, + + setMessage: function(msg_one, msg_two){ + $(".closed_store_msg h3").html(msg_one || "THIS STORE IS CURRENTLY CLOSED") if (app.closed.storeClosedMessageTwo) { - $(".closed_store_msg h4").show().html(app.closed.storeClosedMessageTwo) + $(".closed_store_msg h4").show().html(msg_two) } else { $(".closed_store_msg h4").hide() diff --git a/StoneIsland/www/js/lib/products/CollectionView.js b/StoneIsland/www/js/lib/products/CollectionView.js index 5480c016..3745f563 100755 --- a/StoneIsland/www/js/lib/products/CollectionView.js +++ b/StoneIsland/www/js/lib/products/CollectionView.js @@ -25,6 +25,11 @@ var CollectionView = ScrollableView.extend({ }, show: function(){ + if (! navigator.onLine) { + app.closed.showElement() + app.closed.setMessage("PLEASE GO ONLINE TO BROWSE
THE STONE ISLAND STORE.", "") + return + } if (sdk.env !== "test" && app.closed.storeIsClosed) { return app.closed.show() } -- cgit v1.2.3-70-g09d2