diff options
| author | julie <julie@surfer-172-29-0-85-hotspot.internet-for-guests.com> | 2017-01-23 17:59:26 -0500 |
|---|---|---|
| committer | julie <julie@surfer-172-29-0-85-hotspot.internet-for-guests.com> | 2017-01-23 17:59:26 -0500 |
| commit | 2c41f6b41de6ee1a2ae83e62b8a15ced677a419e (patch) | |
| tree | 9fe4fb9e1d89ad6c3444eac5b5d6696b820775a6 /StoneIsland/platforms/ios/www/js | |
| parent | 267c9ed075b5355f463b8f2ad17e10880f14dfc8 (diff) | |
build
Diffstat (limited to 'StoneIsland/platforms/ios/www/js')
5 files changed, 44 insertions, 8 deletions
diff --git a/StoneIsland/platforms/ios/www/js/index.js b/StoneIsland/platforms/ios/www/js/index.js index 6bea75d0..76a8af05 100755 --- a/StoneIsland/platforms/ios/www/js/index.js +++ b/StoneIsland/platforms/ios/www/js/index.js @@ -8,7 +8,7 @@ var app = (function(){ app.bind() app.build() - + app.iscroll_options = { mouseWheel: true, scrollbars: true, diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js index b7c80520..5ee7f641 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js @@ -31,7 +31,7 @@ var BlogView = View.extend({ this.loaded = true this.data = data = typeof data == "string" ? JSON.parse(data) : data - switch (data.store[0].StoreStatus) { + switch (data.store[0].DepartmentStoreStatus) { case "open": app.closed.storeIsClosed = false break @@ -46,9 +46,9 @@ var BlogView = View.extend({ app.closed.populate(data.store[0].ClosedStoreImages) } else { - app.gallery_id = data.store[0].CollectionId - app.department_id = data.store[0].DepartmentId - app.collection.setCollectionName( data.store[0].collection ) + app.departments = data.store[0].Departments + app.department_id = data.store[0].Departments[0].uri + app.collection.setCollectionName( data.store[0].Departments[0].text ) app.collection.loaded = false app.collection.fetch() } diff --git a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js index b9a7755f..671d36b3 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js @@ -14,6 +14,7 @@ var CollectionView = ScrollableView.extend({ "mousedown .item": "touchstart", "mousemove .item": "touchmove", "mouseup .item": "touchend", + "touchstart h1": "showDepartmentSelector", }, initialize: function(){ @@ -21,7 +22,7 @@ var CollectionView = ScrollableView.extend({ this.$content = this.$(".content") this.$loader = this.$(".loader") this.scroller = new IScroll('#collection', app.iscroll_options) - this.filterView = new CategoryFilter ({ parent: this }) + this.filterView = new DepartmentFilter ({ parent: this }) }, show: function(){ @@ -85,7 +86,7 @@ var CollectionView = ScrollableView.extend({ } console.log(">>>>>>>> YES ") if (! this.loaded) { - console.log("populate 3") + console.log("populate 3", data.SearchResponseFull.Results.Items.length) this.loaded = true this.$loader.hide() this.$content.empty() @@ -140,6 +141,10 @@ var CollectionView = ScrollableView.extend({ this.$title.html(this.collectionName) }, + showDepartmentSelector: function(){ + this.filterView.filter() + }, + firstTouch: { x: 0, y: 0, id: "" }, lastTouch: { x: 0, y: 0, id: "" }, touchstart: function(e){ diff --git a/StoneIsland/platforms/ios/www/js/lib/products/Selector.js b/StoneIsland/platforms/ios/www/js/lib/products/Selector.js index 6db33b68..89130021 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/Selector.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/Selector.js @@ -5,7 +5,7 @@ var Selector = View.extend({ events: { "click .close": "hide", - "click .options div": "pick", + "touchstart .options div": "pick", }, initialize: function(){ diff --git a/StoneIsland/platforms/ios/www/js/lib/products/filters/DepartmentFilter.js b/StoneIsland/platforms/ios/www/js/lib/products/filters/DepartmentFilter.js new file mode 100644 index 00000000..cc0d925e --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/products/filters/DepartmentFilter.js @@ -0,0 +1,31 @@ +var DepartmentFilter = View.extend({ + + initialize: function(opt){ + this.parent = opt.parent + }, + + filter: function(){ + var deps = app.departments.map(function(dep){ + console.log(dep) + return { + id: dep.uri, + label: dep.text, + } + }) + app.selector.select("wide", deps, this.pick.bind(this)) + }, + + last_choice: null, + + pick: function(choice){ + this.parent.$content.empty() + this.last_choice = choice + app.department_id = choice.id + app.collection.loaded = false + app.collection.fetch() + app.footer.hide() + app.collection.setCollectionName(choice.label) + this.parent.deferScrollToTop() + }, + +}) |
