Authored by Rock Zhang

Merge branch 'develop' into test

@@ -16,7 +16,9 @@ var searchH = $('.newbrand-search').outerHeight(), @@ -16,7 +16,9 @@ var searchH = $('.newbrand-search').outerHeight(),
16 headerH = $('.yoho-header').outerHeight(), 16 headerH = $('.yoho-header').outerHeight(),
17 brandSwipe = parseInt(searchH) + parseInt(headerH) - 1; 17 brandSwipe = parseInt(searchH) + parseInt(headerH) - 1;
18 18
19 -var myHammer; 19 +var myHammer, searchBtnHammer, clearTextHammer;
  20 +
  21 +var $rightBarCon = $('#right-bar .con').find('b').unbind();
20 22
21 swiper = new Swiper('.swiper-container', { 23 swiper = new Swiper('.swiper-container', {
22 lazyLoading: true, 24 lazyLoading: true,
@@ -52,14 +54,15 @@ if ($brandList.length > 0) { @@ -52,14 +54,15 @@ if ($brandList.length > 0) {
52 }); 54 });
53 } 55 }
54 56
55 -if ($('#right-bar .con').find('b').unbind()[0]) {  
56 - myHammer = new Hammer($('#right-bar .con').find('b').unbind()[0]); 57 +if ($rightBarCon[0]) {
  58 + myHammer = new Hammer($rightBarCon[0]);
57 myHammer.on('tap', function(e) { 59 myHammer.on('tap', function(e) {
58 - var index = $(this).index(); 60 + var index = $rightBarCon.index();
59 61
60 if ($('.bar-' + index).size() > 0) { 62 if ($('.bar-' + index).size() > 0) {
61 document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1); 63 document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1);
62 } 64 }
  65 + e.srcEvent.stopPropagation();
63 }); 66 });
64 } 67 }
65 68
@@ -87,19 +90,31 @@ $('#keyword').on('keyup', function() { @@ -87,19 +90,31 @@ $('#keyword').on('keyup', function() {
87 $('.search-action').hide(); 90 $('.search-action').hide();
88 }); 91 });
89 92
90 -$('#search-btn').on('tap', function() { 93 +// $('#search-btn').on('tap', function() {
  94 +// searchResult(1);
  95 +// });
  96 +
  97 +searchBtnHammer = new Hammer($('#search-btn')[0]);
  98 +searchBtnHammer.on('tap', function(e) {
91 searchResult(1); 99 searchResult(1);
  100 + e.srcEvent.stopPropagation();
92 }); 101 });
93 102
94 -$('.clear-text').on('tap', function() { 103 +// $('.clear-text').on('tap', function() {
  104 +// $('#keyword').val('').trigger('input');
  105 +// });
  106 +
  107 +clearTextHammer = new Hammer($('.clear-text')[0]);
  108 +clearTextHammer.on('tap', function(e) {
95 $('#keyword').val('').trigger('input'); 109 $('#keyword').val('').trigger('input');
  110 + e.srcEvent.stopPropagation();
96 }); 111 });
97 112
98 $('form.search-box').on('submit', function() { 113 $('form.search-box').on('submit', function() {
99 return false; 114 return false;
100 }); 115 });
101 116
102 -$('.clear-history').on('tap', function() { 117 +$('.clear-history').on('touchstart', function() {
103 118
104 // setcookie('h_brands', '', { 119 // setcookie('h_brands', '', {
105 // expire: -1, 120 // expire: -1,
@@ -60,6 +60,7 @@ if (lifestyleType) { @@ -60,6 +60,7 @@ if (lifestyleType) {
60 $curNav = $this; 60 $curNav = $this;
61 61
62 $(document).trigger('scroll'); //Trigger lazyLoad 62 $(document).trigger('scroll'); //Trigger lazyLoad
  63 + e.srcEvent.stopPropagation();
63 }); 64 });
64 } 65 }
65 66
@@ -44,7 +44,7 @@ function setSubClassify($this) { @@ -44,7 +44,7 @@ function setSubClassify($this) {
44 var html, shower; 44 var html, shower;
45 45
46 if ($this.hasClass('chosed')) { 46 if ($this.hasClass('chosed')) {
47 - return; 47 + return $sub;
48 } 48 }
49 49
50 $sub.children('.chosed').removeClass('chosed'); 50 $sub.children('.chosed').removeClass('chosed');
@@ -11,9 +11,11 @@ @@ -11,9 +11,11 @@
11 lazyLoad($('img.lazy')); 11 lazyLoad($('img.lazy'));
12 12
13 goodsSwiper = new Swiper('.banner-swiper', { 13 goodsSwiper = new Swiper('.banner-swiper', {
  14 + lazyLoading: true,
  15 + lazyLoadingInPrevNext: true,
14 loop: true, 16 loop: true,
15 - pagination: '.banner-top .pagination-inner',  
16 - slideElement: 'div', 17 + paginationClickable: true,
  18 + pagination: '.swiper-pagination',
17 nextButton: '.swiper-button-next', 19 nextButton: '.swiper-button-next',
18 prevButton: '.swiper-button-prev' 20 prevButton: '.swiper-button-prev'
19 }); 21 });
@@ -341,6 +341,7 @@ navHammer.on('tap', function(e) { @@ -341,6 +341,7 @@ navHammer.on('tap', function(e) {
341 search(); 341 search();
342 } 342 }
343 } 343 }
  344 + e.srcEvent.stopPropagation();
344 }); 345 });
345 346
346 $(window).scroll(function() { 347 $(window).scroll(function() {
@@ -358,6 +358,7 @@ navHammer.on('tap', function(e) { @@ -358,6 +358,7 @@ navHammer.on('tap', function(e) {
358 search(); 358 search();
359 } 359 }
360 } 360 }
  361 + e.srcEvent.stopPropagation();
361 }); 362 });
362 363
363 $(window).scroll(function() { 364 $(window).scroll(function() {