OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 6 |
7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
8 | 8 |
9 ///////////////////////////////////////////////////////////////////////////// | 9 ///////////////////////////////////////////////////////////////////////////// |
10 // CookiesView class: | 10 // CookiesView class: |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 chrome.send('updateCookieSearchResults', [filter]); | 81 chrome.send('updateCookieSearchResults', [filter]); |
82 } | 82 } |
83 }, | 83 }, |
84 | 84 |
85 /** | 85 /** |
86 * Handles search query changes. | 86 * Handles search query changes. |
87 * @param {!Event} e The event object. | 87 * @param {!Event} e The event object. |
88 * @private | 88 * @private |
89 */ | 89 */ |
90 handleSearchQueryChange_: function(e) { | 90 handleSearchQueryChange_: function(e) { |
91 var content = document.querySelector('.cookies-search-box').value; | |
92 if (content) { | |
93 document.querySelector('.remove-all-cookies-button').innerHTML = | |
94 loadTimeData.getString('remove_all_shown_cookie'); | |
95 } | |
96 else { | |
97 document.querySelector('.remove-all-cookies-button').innerHTML = | |
98 loadTimeData.getString('remove_all_cookie'); | |
99 } | |
Dan Beam
2014/05/24 02:03:52
i think you can shave some lines with this:
var s
Dan Beam
2014/05/27 21:04:31
what happened to re-writing the code like this? ^
| |
91 if (this.queryDelayTimerId_) | 100 if (this.queryDelayTimerId_) |
92 window.clearTimeout(this.queryDelayTimerId_); | 101 window.clearTimeout(this.queryDelayTimerId_); |
93 | 102 |
94 this.queryDelayTimerId_ = window.setTimeout( | 103 this.queryDelayTimerId_ = window.setTimeout( |
95 this.searchCookie.bind(this), 500); | 104 this.searchCookie.bind(this), 500); |
96 }, | 105 }, |
97 | 106 |
98 initialized_: false, | 107 initialized_: false, |
99 | 108 |
100 /** | 109 /** |
(...skipping 30 matching lines...) Expand all Loading... | |
131 CookiesView.loadChildren = function(args) { | 140 CookiesView.loadChildren = function(args) { |
132 $('cookies-list').loadChildren(args[0], args[1]); | 141 $('cookies-list').loadChildren(args[0], args[1]); |
133 }; | 142 }; |
134 | 143 |
135 // Export | 144 // Export |
136 return { | 145 return { |
137 CookiesView: CookiesView | 146 CookiesView: CookiesView |
138 }; | 147 }; |
139 | 148 |
140 }); | 149 }); |
OLD | NEW |