hexo-theme-hipaper-keyboarddaily 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,6 +54,15 @@
54
54
  </ul>
55
55
  </div>
56
56
  </nav>
57
+ <div id="search-form-menu">
58
+ <form class="search-form">
59
+ <label style="width: 72%;">
60
+ <span class="screen-reader-text">Search for:</span>
61
+ <input type="search" class="search-field" style="height: 36px; width: 100%;" placeholder=" <%= __('search') %>…" value="" name="s" title="Search for:">
62
+ </label>
63
+ <input type="submit" class="search-form-submit" value="<%= __('search') %>">
64
+ </form>
65
+ </div>
57
66
 
58
67
  </div>
59
68
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-hipaper-keyboarddaily",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Bugfix for A newspaper theme for Hexo.",
5
5
  "author": "iTimeTraveler, bugfix by keyboarddaily",
6
6
  "repository": {
@@ -465,6 +465,9 @@ object {
465
465
  font-size: .75em;
466
466
  line-height: normal;
467
467
  }
468
+ #search-form-menu {
469
+ display: none;
470
+ }
468
471
 
469
472
  /* Small Navigation */
470
473
  .nav-open,
@@ -483,6 +486,9 @@ object {
483
486
  .nav-open {
484
487
  display: inline-block;
485
488
  }
489
+ #search-form-menu {
490
+ display: inline-block;
491
+ }
486
492
  #main-navigation:target > .nav-open {
487
493
  display: none;
488
494
  }
@@ -4,6 +4,10 @@
4
4
  isSearchAnim = false,
5
5
  searchAnimDuration = 200;
6
6
 
7
+ var $searchMenu = $('#search-form-menu'),
8
+ isSearchAnim = false,
9
+ searchAnimDuration = 200;
10
+
7
11
  var startSearchAnim = function(){
8
12
  isSearchAnim = true;
9
13
  };
@@ -28,9 +32,20 @@
28
32
  $('.search-form-input').on('blur', function(){
29
33
  startSearchAnim();
30
34
  $searchWrap.removeClass('on');
35
+ $searchMenu.removeClass('on');
31
36
  stopSearchAnim();
32
37
  });
33
38
 
39
+ $('#menu-search-btn').on('click', function(){
40
+ if (isSearchAnim) return;
41
+
42
+ startSearchAnim();
43
+ $searchMenu.addClass('on');
44
+ stopSearchAnim(function(){
45
+ $('.search-form-input').focus();
46
+ });
47
+ });
48
+
34
49
  // Share
35
50
  $('body').on('click', function(){
36
51
  $('.article-share-box.on').removeClass('on');