Showing
1 changed file
with
5 additions
and
1 deletions
@@ -107,7 +107,7 @@ $search.on('touchend', function() { | @@ -107,7 +107,7 @@ $search.on('touchend', function() { | ||
107 | (function() { | 107 | (function() { |
108 | var html = '', | 108 | var html = '', |
109 | history, | 109 | history, |
110 | - historys, i; | 110 | + historys, i, num = 1; |
111 | 111 | ||
112 | if (localStorage) { | 112 | if (localStorage) { |
113 | historys = localStorage.getItem('historys'); | 113 | historys = localStorage.getItem('historys'); |
@@ -121,6 +121,10 @@ $search.on('touchend', function() { | @@ -121,6 +121,10 @@ $search.on('touchend', function() { | ||
121 | continue; | 121 | continue; |
122 | } | 122 | } |
123 | 123 | ||
124 | + if (num++ > 10) { | ||
125 | + break; | ||
126 | + } | ||
127 | + | ||
124 | html += '<li><a href="/?query=' + history + '">' + history + '</li>'; | 128 | html += '<li><a href="/?query=' + history + '">' + history + '</li>'; |
125 | } | 129 | } |
126 | 130 |
-
Please register or login to post a comment