diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-19 20:56:10 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-19 20:56:10 -0500 |
| commit | ef5b4aaca99b811d0399f40d4ca79c642cf6bf31 (patch) | |
| tree | 2332370c585e1df0a38d3ad3edb9aaebcd8465f4 /StoneIsland/www/js | |
| parent | 74e7f60ddccf181aa80259fb9eac4c84f17a070b (diff) | |
ClosedStoreView
Diffstat (limited to 'StoneIsland/www/js')
| -rw-r--r-- | StoneIsland/www/js/index.js | 9 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/_router.js | 1 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/BlogView.js | 3 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/products/ClosedStoreView.js | 43 |
4 files changed, 52 insertions, 4 deletions
diff --git a/StoneIsland/www/js/index.js b/StoneIsland/www/js/index.js index 07819ca4..dec2d0cd 100644 --- a/StoneIsland/www/js/index.js +++ b/StoneIsland/www/js/index.js @@ -33,6 +33,7 @@ var app = (function(){ app.cart = new CartView () + app.intro = new IntroView () app.header = new HeaderView () app.footer = new FooterView () app.curtain = new CurtainView () @@ -48,16 +49,16 @@ var app = (function(){ app.settings = new SettingsView () app.orders = new OrdersView () - app.intro = new IntroView () app.terms = new PageView ({ page: "terms" }) app.privacy = new PageView ({ page: "privacy" }) app.returns = new PageView ({ page: "returns" }) app.care = new PageView ({ page: "care" }) - app.search = new SearchView () - app.product = new ProductView () app.collection = new CollectionView () - + app.product = new ProductView () + app.closed = new ClosedStoreView () + app.search = new SearchView () + app.selector = new Selector () } diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js index 80ea9c39..c6f543a5 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', diff --git a/StoneIsland/www/js/lib/blogs/BlogView.js b/StoneIsland/www/js/lib/blogs/BlogView.js index 85ff8a35..54030bd8 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.store.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..02e7b312 --- /dev/null +++ b/StoneIsland/www/js/lib/products/ClosedStoreView.js @@ -0,0 +1,43 @@ +var ClosedStoreView = new View ({ + + el: "#closed", + + events: { + "click .website_link": "website_link", + }, + + delay: 8000, + + timeout: -1, + images: null, + + initialize: function(){ + this.loader = new Loader () + }, + + show: function(){ + this.animate() + }, + + 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 |
