OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('options', function() { | 5 cr.define('options', function() { |
6 const OptionsPage = options.OptionsPage; | 6 const OptionsPage = options.OptionsPage; |
7 | 7 |
8 /** | 8 /** |
9 * Encapsulated handling of a search bubble. | 9 * Encapsulated handling of a search bubble. |
10 * @constructor | 10 * @constructor |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 if (childDiv.tagName != 'SECTION') | 242 if (childDiv.tagName != 'SECTION') |
243 childDiv.classList.add('search-hidden'); | 243 childDiv.classList.add('search-hidden'); |
244 } else { | 244 } else { |
245 childDiv.classList.remove('search-hidden'); | 245 childDiv.classList.remove('search-hidden'); |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 if (active) { | 249 if (active) { |
250 // When search is active, remove the 'hidden' tag. This tag may have | 250 // When search is active, remove the 'hidden' tag. This tag may have |
251 // been added by the OptionsPage. | 251 // been added by the OptionsPage. |
252 page.pageDiv.classList.remove('hidden'); | 252 page.pageDiv.hidden = false; |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 if (active) { | 256 if (active) { |
257 this.setSearchText_(this.searchField.value); | 257 this.setSearchText_(this.searchField.value); |
258 } else { | 258 } else { |
259 // After hiding all page content, remove any search results. | 259 // After hiding all page content, remove any search results. |
260 this.unhighlightMatches_(); | 260 this.unhighlightMatches_(); |
261 this.removeSearchBubbles_(); | 261 this.removeSearchBubbles_(); |
262 } | 262 } |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 // Trim beginning and ending whitespace. | 549 // Trim beginning and ending whitespace. |
550 return text.replace(/^\s+|\s+$/g, ''); | 550 return text.replace(/^\s+|\s+$/g, ''); |
551 }; | 551 }; |
552 | 552 |
553 // Export | 553 // Export |
554 return { | 554 return { |
555 SearchPage: SearchPage | 555 SearchPage: SearchPage |
556 }; | 556 }; |
557 | 557 |
558 }); | 558 }); |
OLD | NEW |