Showing
1 changed file
with
6 additions
and
9 deletions
@@ -35,7 +35,7 @@ var searchH = $('.newbrand-search').outerHeight(), | @@ -35,7 +35,7 @@ var searchH = $('.newbrand-search').outerHeight(), | ||
35 | minBrandListTop; | 35 | minBrandListTop; |
36 | 36 | ||
37 | var brandsData, | 37 | var brandsData, |
38 | - $keyword, | 38 | + $keyword = $('#keyword'), |
39 | clearTextHammer; | 39 | clearTextHammer; |
40 | 40 | ||
41 | var $history = $('.local-history'); | 41 | var $history = $('.local-history'); |
@@ -116,7 +116,7 @@ function isLocalStorageSupported() { | @@ -116,7 +116,7 @@ function isLocalStorageSupported() { | ||
116 | } | 116 | } |
117 | 117 | ||
118 | //绑定提交前的存local操作 | 118 | //绑定提交前的存local操作 |
119 | -function bindWirteLocal($brandList, list) { | 119 | +function bindWriteLocal($brandList, list) { |
120 | $brandList.on('click', 'p , li', function(e) { | 120 | $brandList.on('click', 'p , li', function(e) { |
121 | var brandName, brandId, brandDomain, url; | 121 | var brandName, brandId, brandDomain, url; |
122 | var a = $(this).find('a'); | 122 | var a = $(this).find('a'); |
@@ -124,8 +124,6 @@ function bindWirteLocal($brandList, list) { | @@ -124,8 +124,6 @@ function bindWirteLocal($brandList, list) { | ||
124 | var query = a.attr('brandName') + ranToken2 + myDate.getTime(), | 124 | var query = a.attr('brandName') + ranToken2 + myDate.getTime(), |
125 | historys; | 125 | historys; |
126 | 126 | ||
127 | - $keyword = $('#keyword'); | ||
128 | - | ||
129 | brandName = a.attr('brandName'); | 127 | brandName = a.attr('brandName'); |
130 | 128 | ||
131 | brandId = a.attr('brandId'); | 129 | brandId = a.attr('brandId'); |
@@ -241,7 +239,7 @@ function searchResult() { | @@ -241,7 +239,7 @@ function searchResult() { | ||
241 | // 插入 dom,绑定事件 | 239 | // 插入 dom,绑定事件 |
242 | $('.search-result').html(html); | 240 | $('.search-result').html(html); |
243 | changeBackground(); | 241 | changeBackground(); |
244 | - bindWirteLocal($('.brand-list'), true); | 242 | + bindWriteLocal($('.brand-list'), true); |
245 | } | 243 | } |
246 | 244 | ||
247 | loading.showLoadingMask(); | 245 | loading.showLoadingMask(); |
@@ -333,21 +331,20 @@ if ($('.brand-index-page').length > 0) { | @@ -333,21 +331,20 @@ if ($('.brand-index-page').length > 0) { | ||
333 | 331 | ||
334 | 332 | ||
335 | if ($('.history-search').length > 0) { | 333 | if ($('.history-search').length > 0) { |
336 | - bindWirteLocal($('.history-search'), false); | 334 | + bindWriteLocal($('.history-search'), false); |
337 | } | 335 | } |
338 | 336 | ||
339 | if ($('.hot-search').length > 0) { | 337 | if ($('.hot-search').length > 0) { |
340 | - bindWirteLocal($('.hot-search'), false); | 338 | + bindWriteLocal($('.hot-search'), false); |
341 | } | 339 | } |
342 | 340 | ||
343 | if ($('.brand-search-page').length > 0) { | 341 | if ($('.brand-search-page').length > 0) { |
344 | brandsData = $.parseJSON($('#brands-data').html()); | 342 | brandsData = $.parseJSON($('#brands-data').html()); |
345 | - $keyword = $('#keyword'); | ||
346 | 343 | ||
347 | $keyword.on('input', function() { | 344 | $keyword.on('input', function() { |
348 | searchInput(); | 345 | searchInput(); |
349 | 346 | ||
350 | - }).focus(); | 347 | + }); |
351 | 348 | ||
352 | // 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮 | 349 | // 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮 |
353 | $icon.css('color', '#444'); | 350 | $icon.css('color', '#444'); |
-
Please register or login to post a comment