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

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: 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
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 $('homepageUseURLButton').onchange = 89 $('homepageUseURLButton').onchange =
90 this.handleHomepageUseURLButtonChange_.bind(this); 90 this.handleHomepageUseURLButtonChange_.bind(this);
91 homepageField.onchange = this.handleHomepageURLChange_.bind(this); 91 homepageField.onchange = this.handleHomepageURLChange_.bind(this);
92 homepageField.oninput = this.handleHomepageURLChange_.bind(this); 92 homepageField.oninput = this.handleHomepageURLChange_.bind(this);
93 homepageField.addEventListener('focus', function(event) { 93 homepageField.addEventListener('focus', function(event) {
94 self.autocompleteList_.attachToInput(homepageField); 94 self.autocompleteList_.attachToInput(homepageField);
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 // Text fields may change widths when the window changes size, so make
100 // sure the suggestion list stays in sync.
101 window.addEventListener('resize', function() {
102 self.autocompleteList_.syncWidthToInput();
103 });
99 104
100 // Ensure that changes are committed when closing the page. 105 // Ensure that changes are committed when closing the page.
101 window.addEventListener('unload', function() { 106 window.addEventListener('unload', function() {
102 if (document.activeElement == homepageField) 107 if (document.activeElement == homepageField)
103 homepageField.blur(); 108 homepageField.blur();
104 }); 109 });
105 110
106 if (!cr.isChromeOS) { 111 if (!cr.isChromeOS) {
107 $('defaultBrowserUseAsDefaultButton').onclick = function(event) { 112 $('defaultBrowserUseAsDefaultButton').onclick = function(event) {
108 chrome.send('becomeDefaultBrowser'); 113 chrome.send('becomeDefaultBrowser');
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 BrowserOptions.updateAutocompleteSuggestions = function(suggestions) { 473 BrowserOptions.updateAutocompleteSuggestions = function(suggestions) {
469 BrowserOptions.getInstance().updateAutocompleteSuggestions_(suggestions); 474 BrowserOptions.getInstance().updateAutocompleteSuggestions_(suggestions);
470 }; 475 };
471 476
472 // Export 477 // Export
473 return { 478 return {
474 BrowserOptions: BrowserOptions 479 BrowserOptions: BrowserOptions
475 }; 480 };
476 481
477 }); 482 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698