Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: chrome/browser/resources/options/browser_options.js

Issue 6898001: WebUI Prefs: Resize autocomplete list on window resize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Condense syncWidthToInput Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/options/autocomplete_list.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 const ArrayDataModel = cr.ui.ArrayDataModel; 7 const ArrayDataModel = cr.ui.ArrayDataModel;
8 8
9 // 9 //
10 // BrowserOptions class 10 // BrowserOptions class
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 }); 95 });
96 homepageField.addEventListener('blur', function(event) { 96 homepageField.addEventListener('blur', function(event) {
97 self.autocompleteList_.detach(); 97 self.autocompleteList_.detach();
98 }); 98 });
99 homepageField.addEventListener('keydown', function(event) { 99 homepageField.addEventListener('keydown', function(event) {
100 // Remove focus when the user hits enter since people expect feedback 100 // Remove focus when the user hits enter since people expect feedback
101 // indicating that they are done editing. 101 // indicating that they are done editing.
102 if (event.keyIdentifier == 'Enter') 102 if (event.keyIdentifier == 'Enter')
103 homepageField.blur(); 103 homepageField.blur();
104 }); 104 });
105 // Text fields may change widths when the window changes size, so make
106 // sure the suggestion list stays in sync.
107 window.addEventListener('resize', function() {
108 self.autocompleteList_.syncWidthToInput();
109 });
105 110
106 // Ensure that changes are committed when closing the page. 111 // Ensure that changes are committed when closing the page.
107 window.addEventListener('unload', function() { 112 window.addEventListener('unload', function() {
108 if (document.activeElement == homepageField) 113 if (document.activeElement == homepageField)
109 homepageField.blur(); 114 homepageField.blur();
110 }); 115 });
111 116
112 if (!cr.isChromeOS) { 117 if (!cr.isChromeOS) {
113 $('defaultBrowserUseAsDefaultButton').onclick = function(event) { 118 $('defaultBrowserUseAsDefaultButton').onclick = function(event) {
114 chrome.send('becomeDefaultBrowser'); 119 chrome.send('becomeDefaultBrowser');
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 BrowserOptions.updateAutocompleteSuggestions = function(suggestions) { 479 BrowserOptions.updateAutocompleteSuggestions = function(suggestions) {
475 BrowserOptions.getInstance().updateAutocompleteSuggestions_(suggestions); 480 BrowserOptions.getInstance().updateAutocompleteSuggestions_(suggestions);
476 }; 481 };
477 482
478 // Export 483 // Export
479 return { 484 return {
480 BrowserOptions: BrowserOptions 485 BrowserOptions: BrowserOptions
481 }; 486 };
482 487
483 }); 488 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/autocomplete_list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698