Authored by 沈志敏

fix bug

@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 var $ = require('yoho-jquery'); 7 var $ = require('yoho-jquery');
8 8
9 var $nav = $('.category-nav'), 9 var $nav = $('.category-nav'),
  10 + $search = $('#search-input'),
10 $categoryContainer = $('.category-container'), 11 $categoryContainer = $('.category-container'),
11 $contents = $categoryContainer.children('.content'), 12 $contents = $categoryContainer.children('.content'),
12 $subLevelItem = $categoryContainer.find('.sub-level li'), 13 $subLevelItem = $categoryContainer.find('.sub-level li'),
@@ -14,7 +15,13 @@ var $nav = $('.category-nav'), @@ -14,7 +15,13 @@ var $nav = $('.category-nav'),
14 15
15 require('../common'); 16 require('../common');
16 17
17 -$('#search-input').focus(function() { 18 +function resetHeight() {
  19 + var h = document.body.scrollHeight - $search.outerHeight() - $nav.outerHeight();
  20 + $contents.height(h);
  21 +}
  22 +resetHeight();
  23 +
  24 +$search.focus(function() {
18 $(this).blur(); 25 $(this).blur();
19 }); 26 });
20 $nav.on('contextmenu', function() { 27 $nav.on('contextmenu', function() {
@@ -77,7 +77,10 @@ @@ -77,7 +77,10 @@
77 } 77 }
78 78
79 .content { 79 .content {
  80 + background: #f8f8f8;
80 overflow: hidden; 81 overflow: hidden;
  82 + position: relative;
  83 +
81 &.hide { 84 &.hide {
82 display: none; 85 display: none;
83 } 86 }
@@ -87,7 +90,6 @@ @@ -87,7 +90,6 @@
87 float: left; 90 float: left;
88 box-sizing: border-box; 91 box-sizing: border-box;
89 width: 45%; 92 width: 45%;
90 - background: #f8f8f8;  
91 93
92 > li { 94 > li {
93 height: 89px; 95 height: 89px;
@@ -108,10 +110,13 @@ @@ -108,10 +110,13 @@
108 } 110 }
109 111
110 .sub-level-container { 112 .sub-level-container {
111 - float: left; 113 + position: absolute;
  114 + right: 0;
  115 + overflow-x: auto;
112 box-sizing: border-box; 116 box-sizing: border-box;
113 background: #fff; 117 background: #fff;
114 width: 55%; 118 width: 55%;
  119 + height: 100%;
115 } 120 }
116 121
117 .sub-level { 122 .sub-level {