|
@@ -9,14 +9,21 @@ var $searchBox = $('.search-box'), |
|
@@ -9,14 +9,21 @@ var $searchBox = $('.search-box'), |
9
|
$indexSearch = $('.index-search'),
|
9
|
$indexSearch = $('.index-search'),
|
10
|
$indexLogo = $('.index-logo');
|
10
|
$indexLogo = $('.index-logo');
|
11
|
|
11
|
|
12
|
-var $search = $searchBox.children('input'),
|
|
|
13
|
- $cancelSearch = $indexSearch.children('.no-search');
|
12
|
+var $search = $searchBox.children('input[type="text"]'),
|
|
|
13
|
+ $cancelSearch = $indexSearch.children('.no-search'),
|
|
|
14
|
+ $searchIcon = $searchBox.children('.search-icon');
|
14
|
|
15
|
|
15
|
require('../common');
|
16
|
require('../common');
|
16
|
|
17
|
|
17
|
$search.on('focus', function() {
|
18
|
$search.on('focus', function() {
|
18
|
$indexSearch.addClass('action');
|
19
|
$indexSearch.addClass('action');
|
19
|
$indexLogo.addClass('action');
|
20
|
$indexLogo.addClass('action');
|
|
|
21
|
+}).on('input', function() {
|
|
|
22
|
+ if ($search.val() === '') {
|
|
|
23
|
+ $searchIcon.addClass('empty');
|
|
|
24
|
+ } else {
|
|
|
25
|
+ $searchIcon.removeClass('empty');
|
|
|
26
|
+ }
|
20
|
});
|
27
|
});
|
21
|
|
28
|
|
22
|
$cancelSearch.on('touchstart', function() {
|
29
|
$cancelSearch.on('touchstart', function() {
|