diff options
Diffstat (limited to 'StoneIsland/www/js/lib')
| -rw-r--r-- | StoneIsland/www/js/lib/_router.js | 4 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/account/OrdersView.js | 1 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/BlogView.js | 3 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/products/ClosedStoreView.js | 45 |
4 files changed, 53 insertions, 0 deletions
diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js index 80ea9c39..712d3db2 100644 --- a/StoneIsland/www/js/lib/_router.js +++ b/StoneIsland/www/js/lib/_router.js @@ -11,6 +11,7 @@ var SiteRouter = Router.extend({ '/archive': 'archive', '/store': 'collection', + '/store/closed': 'closed', '/store/:code': 'product', '/account/login': 'login', @@ -58,6 +59,9 @@ var SiteRouter = Router.extend({ default_view: function(name){ var fn = function(){ console.log(name) + if (app.view && app.view.hide) { + app.view.hide() + } if (name.match(/\./)) { var n = name.split(".") console.log(name, n) diff --git a/StoneIsland/www/js/lib/account/OrdersView.js b/StoneIsland/www/js/lib/account/OrdersView.js index 78a67e43..f9a2a35c 100644 --- a/StoneIsland/www/js/lib/account/OrdersView.js +++ b/StoneIsland/www/js/lib/account/OrdersView.js @@ -13,6 +13,7 @@ var OrdersView = View.extend({ }, show: function(){ + app.footer.hide() document.body.className = "orders" this.el.className = "list" }, diff --git a/StoneIsland/www/js/lib/blogs/BlogView.js b/StoneIsland/www/js/lib/blogs/BlogView.js index 85ff8a35..50313aa8 100644 --- a/StoneIsland/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/www/js/lib/blogs/BlogView.js @@ -31,6 +31,9 @@ var BlogView = View.extend({ data.page.forEach(function(page){ app[page.tag].populate(page) }) + if (data.store[0].StoreIsOpen !== "True") { + app.closed.populate(data.store[0].ClosedStoreImages) + } }, })
\ No newline at end of file diff --git a/StoneIsland/www/js/lib/products/ClosedStoreView.js b/StoneIsland/www/js/lib/products/ClosedStoreView.js new file mode 100644 index 00000000..c4e929b3 --- /dev/null +++ b/StoneIsland/www/js/lib/products/ClosedStoreView.js @@ -0,0 +1,45 @@ +var ClosedStoreView = View.extend({ + + el: "#closed", + + events: { + "click .website_link": "website_link", + }, + + delay: 8000, + + timeout: -1, + images: null, + + initialize: function(){ + this.loader = new Loader () + }, + + show: function(){ + document.body.className = "closed" + this.animate() + app.footer.hide() + }, + + hide: function(){ + clearTimeout(this.timeout) + }, + + animate: function(){ + this.timeout = setTimeout(this.animate.bind(this), this.delay) + if (! this.images) return + var url = choice(this.images) + this.loader.preloadImage(url, function(img){ + this.el.style.backgroundImage = 'url(' + img.src + ')' + }.bind(this)) + }, + + populate: function(data){ + this.images = data.map(function(img){ return img.uri }) + }, + + website_link: function(){ + window.open("http://www.stoneisland.com/", '_system') + }, + +})
\ No newline at end of file |
