summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/products
diff options
context:
space:
mode:
authorRene Ae <aehtyb@gmail.com>2015-12-08 20:55:47 -0600
committerRene Ae <aehtyb@gmail.com>2015-12-08 20:55:47 -0600
commitea6860e8d1d8f8b5dac999373feed0a98534f213 (patch)
tree2c6c8a0c25826accc9a828a50921f37c91359101 /StoneIsland/www/js/lib/products
parentf757b2c031bd6f44e4ee40227f68605958cdc099 (diff)
android modifications
Diffstat (limited to 'StoneIsland/www/js/lib/products')
-rw-r--r--StoneIsland/www/js/lib/products/ClosedStoreView.js2
-rw-r--r--StoneIsland/www/js/lib/products/ProductView.js20
-rw-r--r--StoneIsland/www/js/lib/products/Selector.js16
-rw-r--r--StoneIsland/www/js/lib/products/filters/CategoryFilter.js2
4 files changed, 27 insertions, 13 deletions
diff --git a/StoneIsland/www/js/lib/products/ClosedStoreView.js b/StoneIsland/www/js/lib/products/ClosedStoreView.js
index 5f8c1e84..c42e1828 100644
--- a/StoneIsland/www/js/lib/products/ClosedStoreView.js
+++ b/StoneIsland/www/js/lib/products/ClosedStoreView.js
@@ -5,7 +5,7 @@ var ClosedStoreView = View.extend({
storeIsClosed: false,
events: {
- "click .website_link": "website_link",
+ "touchstart .website_link": "website_link",
},
delay: 8000,
diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js
index 4789850a..9d518b11 100644
--- a/StoneIsland/www/js/lib/products/ProductView.js
+++ b/StoneIsland/www/js/lib/products/ProductView.js
@@ -4,12 +4,12 @@ var ProductView = ScrollableView.extend({
el: "#product",
events: {
- "click .fit": "scroll_to_bottom",
- "click .size": "select_size",
- "click .color": "select_color",
- "click .share": "share",
- "click .gallery-left": "gallery_left",
- "click .gallery-right": "gallery_right",
+ "touchstart .fit": "scroll_to_bottom",
+ "touchstart .size": "select_size",
+ "touchstart .color": "select_color",
+ "touchstart .share": "share",
+ "touchstart .gallery-left": "gallery_left",
+ "touchstart .gallery-right": "gallery_right",
},
initialize: function(){
@@ -21,6 +21,7 @@ var ProductView = ScrollableView.extend({
this.$type = this.$(".type")
this.$price = this.$(".price")
this.$size = this.$(".size")
+ this.$share = this.$(".share")
this.$color = this.$(".color")
this.$body = this.$(".body")
this.$fit = this.$(".fit")
@@ -202,12 +203,14 @@ var ProductView = ScrollableView.extend({
},
select_size: function(){
+
if (this.is_onesize) { return this.select_color() }
if (this.item['Sizes'].length == 0) { return }
var sizes = Object.keys(this.sizes).map(function(key){
return this.sizes[key]
}.bind(this))
- app.selector.select(sizes, function(size){
+
+ app.selector.select("style", sizes, function(size){
this.size = size.value
this.$size.html(size.label)
}.bind(this))
@@ -218,7 +221,7 @@ var ProductView = ScrollableView.extend({
var colors = Object.keys(this.colors).map(function(key){
return this.colors[key]
}.bind(this))
- app.selector.select(colors, function(color){
+ app.selector.select("style", colors, function(color){
this.code = color.code
this.$color.html(color.label)
}.bind(this))
@@ -267,6 +270,7 @@ var ProductView = ScrollableView.extend({
},
share: function(){
+ console.log("share")
window.plugins.socialsharing.share( this.item['ModelNames'], null, null, "http://stoneisland.com/")
},
diff --git a/StoneIsland/www/js/lib/products/Selector.js b/StoneIsland/www/js/lib/products/Selector.js
index 76c498ec..1b91cf80 100644
--- a/StoneIsland/www/js/lib/products/Selector.js
+++ b/StoneIsland/www/js/lib/products/Selector.js
@@ -4,7 +4,7 @@ var Selector = View.extend({
template: $("#selector .template").html(),
events: {
- "click .close": "hide",
+ "touchstart .close": "hide",
"click .options div": "pick",
},
@@ -14,7 +14,7 @@ var Selector = View.extend({
lookup: null,
callback: null,
- select: function(options, callback){
+ select: function(origin, options, callback){
this.lookup = {}
this.callback = callback || function(item){ console.log(item) }
this.$options.empty()
@@ -27,6 +27,17 @@ var Selector = View.extend({
this.$el.show()
app.curtain.show("white")
this.visible = true
+ var selectionXY = $("." + origin).offset()
+ var selectionWidth = $("." + origin).width()
+ var selectorHeight = $('#selector').height()
+ console.log(selectionXY.left)
+ console.log(selectionXY.top)
+
+ $("#selector").css({"top":(selectionXY.top - selectorHeight),"left":selectionXY.left})
+
+
+
+
},
hide: function(){
@@ -40,7 +51,6 @@ var Selector = View.extend({
var $option = $(e.currentTarget)
var id = String($option.data("id"))
var selection = this.lookup[id]
-
this.callback( selection )
this.hide()
},
diff --git a/StoneIsland/www/js/lib/products/filters/CategoryFilter.js b/StoneIsland/www/js/lib/products/filters/CategoryFilter.js
index 4e6baf62..53f9a59b 100644
--- a/StoneIsland/www/js/lib/products/filters/CategoryFilter.js
+++ b/StoneIsland/www/js/lib/products/filters/CategoryFilter.js
@@ -17,7 +17,7 @@ var CategoryFilter = View.extend({
label: "REMOVE FILTER",
})
}
- app.selector.select(cats, this.pick.bind(this))
+ app.selector.select("wide", cats, this.pick.bind(this))
},
last_choice: null,