diff options
| author | Rene Ae <aehtyb@gmail.com> | 2015-12-09 17:37:55 -0600 |
|---|---|---|
| committer | Rene Ae <aehtyb@gmail.com> | 2015-12-09 17:37:55 -0600 |
| commit | 0791548d795548240d89683cb3a041ae863a5c93 (patch) | |
| tree | 45bfb09c7377a12c9528d8f4a719a94dc29d3532 /StoneIsland/platforms/ios/www/js | |
| parent | 6f468508553cc7231367d3ed35dba54283bdebb6 (diff) | |
android
Diffstat (limited to 'StoneIsland/platforms/ios/www/js')
18 files changed, 62 insertions, 37 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/_router.js b/StoneIsland/platforms/ios/www/js/lib/_router.js index b1fa1c97..5cd09d6c 100755 --- a/StoneIsland/platforms/ios/www/js/lib/_router.js +++ b/StoneIsland/platforms/ios/www/js/lib/_router.js @@ -86,6 +86,7 @@ var SiteRouter = Router.extend({ app.view = app[name] } app.header.set_back( !! app.view.back ) + console.log("showing now") app.view.show() }.bind(this) return fn diff --git a/StoneIsland/platforms/ios/www/js/lib/account/OrdersView.js b/StoneIsland/platforms/ios/www/js/lib/account/OrdersView.js index a1b83767..e51676e0 100755 --- a/StoneIsland/platforms/ios/www/js/lib/account/OrdersView.js +++ b/StoneIsland/platforms/ios/www/js/lib/account/OrdersView.js @@ -8,8 +8,8 @@ var OrdersView = ScrollableView.extend({ item_template: $("#orders .item_template").html(), events: { - "click .back": "back", - "click .item": "load_single", + "touchstart .back": "back", + "touchstart .item": "load_single", }, initialize: function(){ diff --git a/StoneIsland/platforms/ios/www/js/lib/auth/LoginView.js b/StoneIsland/platforms/ios/www/js/lib/auth/LoginView.js index 1f7438cc..f96d1e44 100755 --- a/StoneIsland/platforms/ios/www/js/lib/auth/LoginView.js +++ b/StoneIsland/platforms/ios/www/js/lib/auth/LoginView.js @@ -5,7 +5,7 @@ var LoginView = FormView.extend({ action: sdk.account.login, events: { - "click .newuser": "new_user", + "touchstart .newuser": "new_user", "submit form": "save", }, diff --git a/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js b/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js index afbb8877..19c07c32 100755 --- a/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js +++ b/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js @@ -20,7 +20,7 @@ var SignupView = FormView.extend({ */ events: { - "click .privacy-msg": "privacy_link", + "touchstart .privacy-msg": "privacy_link", "submit form": "save", }, diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js index 254df6d1..2802ab9e 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js @@ -5,7 +5,7 @@ var ArchiveView = ScrollableView.extend({ row_template: $("#archive .scroll .template").html(), events: { - "click .item": "pick", + "touchstart .item": "pick", "mousedown .row": "mousedown", "touchstart .row": "touchstart", "mousemove .row": "mousemove", diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js index 49c05ff6..b2fb16db 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js @@ -4,11 +4,11 @@ var HubView = ScrollableView.extend({ template: $("#hub .template").html(), events: { - "click .share": "content-share", - "click .store": "store_link", - "click .gallery-left": "gallery_left", - "click .gallery-right": "gallery_right", - "click .play": "play_video", + "touchstart .share": "content-share", + "touchstart .store": "store_link", + "touchstart .gallery-left": "gallery_left", + "touchstart .gallery-right": "gallery_right", + "touchstart .play": "play_video", }, initialize: function(){ diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js index 84684ff7..ee7193a6 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js @@ -6,7 +6,7 @@ var StoryView = ScrollableView.extend({ template: $("#story .template").html(), events: { - "click .links li": "pick", + "touchstart .links li": "pick", }, initialize: function(){ @@ -58,7 +58,11 @@ var StoryView = ScrollableView.extend({ this.$content.find("[data-id=" + id + "]").addClass("active") var section = this.sections[id] - this.$img.attr("src", section.image.uri) + var replace = this.$img + // optional image transition.. ? + this.$img.fadeTo(110,0.65, function() { + replace.attr("src", section.image.uri) + }).fadeTo(130,1) this.deferScrollToTop() }, diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js index f3c54d55..7dd4db7c 100755 --- a/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js +++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js @@ -13,8 +13,8 @@ var CartPayment = FormView.extend({ events: { "change [name=SameAsShipping]": "toggle_shipping", - "click .address_dropdown": "toggle_address", - "click .cc_dropdown": "toggle_cc", + "touchstart .address_dropdown": "toggle_address", + "touchstart .cc_dropdown": "toggle_cc", }, initialize: function(opt){ diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js index f17d42d2..33b082c0 100755 --- a/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js +++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js @@ -10,7 +10,7 @@ var CartShipping = FormView.extend({ template: $("#cart_shipping .template").html(), events: { - "click .dropdown-wrapper": "toggle_dropdown", + "touchstart .dropdown-wrapper": "toggle_dropdown", }, initialize: function(opt){ diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js index ff1e001f..51b9cb80 100755 --- a/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js +++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js @@ -5,7 +5,7 @@ var CartSummary = ScrollableView.extend({ template: $("#cart_summary .template").html(), events: { - "click .remove": "remove_item", + "touchstart .remove": "remove_item", }, data: null, @@ -156,6 +156,7 @@ var CartSummary = ScrollableView.extend({ this.parent.$itemcount.html("0 ITEMS") this.el.className = "empty" this.parent.$steps.hide() + app.curtain.hide("loading") }, save: function(){ @@ -188,12 +189,17 @@ var CartSummary = ScrollableView.extend({ } app.curtain.show("loading") + console.log("loading") sdk.cart.delete_item({ data: { Code10: data.code, Size: data.size, }, success: function(){ + console.log("success") + app.curtain.hide("loading") + }, + error: function(){ app.curtain.hide("loading") }, }) diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js index 1b08e418..0e04c025 100755 --- a/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js +++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js @@ -3,9 +3,9 @@ var CartView = View.extend({ el: "#cart", events: { - "click .summary_step": "show_summary", - "click .shipping_step": "show_shipping", - "click .payment_step": "show_payment", + "touchstart .summary_step": "show_summary", + "touchstart .shipping_step": "show_shipping", + "touchstart .payment_step": "show_payment", }, initialize: function(){ diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js b/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js index b2f01208..73fe106d 100755 --- a/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js +++ b/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js @@ -45,7 +45,7 @@ var HeaderView = View.extend({ count: 0, set_cart_count: function(n){ this.count = n - this.$cart_count.html(n || " ") + this.$cart_count.html(n || "0") }, increment_cart_count: function(){ this.$cart_count.html( ++this.count ) diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js b/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js index 5f8c1e84..c42e1828 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js +++ b/StoneIsland/platforms/ios/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/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js index 4789850a..9d518b11 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/ios/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/platforms/ios/www/js/lib/products/Selector.js b/StoneIsland/platforms/ios/www/js/lib/products/Selector.js index 76c498ec..1b91cf80 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/Selector.js +++ b/StoneIsland/platforms/ios/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/platforms/ios/www/js/lib/products/filters/CategoryFilter.js b/StoneIsland/platforms/ios/www/js/lib/products/filters/CategoryFilter.js index 4e6baf62..53f9a59b 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/filters/CategoryFilter.js +++ b/StoneIsland/platforms/ios/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, diff --git a/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js b/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js index 98aa8ce3..921dc275 100755 --- a/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js +++ b/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js @@ -4,7 +4,7 @@ var SerializableView = View.extend({ "change select": "update_select", "change [type=date]": "update_date", "focus input": "focus_input", - "click .date-wrapper": "focus_date", + "touchstart .date-wrapper": "focus_date", "submit form": "save", }, diff --git a/StoneIsland/platforms/ios/www/js/lib/view/View.js b/StoneIsland/platforms/ios/www/js/lib/view/View.js index 41638ab7..70d2c7eb 100755 --- a/StoneIsland/platforms/ios/www/js/lib/view/View.js +++ b/StoneIsland/platforms/ios/www/js/lib/view/View.js @@ -64,9 +64,9 @@ var View = (function($, _){ if (eventName === 'mouseenter' || eventName === 'mouseleave') { continue } -// if (eventName === 'click') { -// eventName = 'tap' -// } + if (eventName === 'click') { + eventName = 'touchstart' + } } if (selector === '') { this.$el.on(eventName, method); |
