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

Unified Diff: chrome/browser/resources/options/cookies_view.js

Issue 6990030: WebUI: size the cookies list according to the window height. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/options/cookies_view.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/cookies_view.js
===================================================================
--- chrome/browser/resources/options/cookies_view.js (revision 86234)
+++ chrome/browser/resources/options/cookies_view.js (working copy)
@@ -50,6 +50,7 @@
var cookiesList = $('cookies-list');
options.CookiesList.decorate(cookiesList);
+ window.addEventListener('resize', this.handleResize_.bind(this));
this.addEventListener('visibleChange', this.handleVisibleChange_);
},
@@ -83,12 +84,14 @@
/**
* Handler for OptionsPage's visible property change event.
+ * @param {Event} e Property change event.
* @private
- * @param {Event} e Property change event.
*/
handleVisibleChange_: function(e) {
if (!this.visible)
return;
+ // Resize the cookies list whenever the options page becomes visible.
+ this.handleResize_(null);
if (!this.initialized_) {
this.initialized_ = true;
this.searchCookie();
@@ -96,6 +99,21 @@
$('cookies-list').redraw();
}
},
+
+ /**
+ * Handler for when the window changes size. Resizes the cookies list to
+ * match the window height.
+ * @param {?Event} e Window resize event, or null if called directly.
+ * @private
+ */
+ handleResize_: function(e) {
+ if (!this.visible)
+ return;
+ var cookiesList = $('cookies-list');
+ // 25 pixels from the window bottom seems like a visually pleasing amount.
+ var height = window.innerHeight - cookiesList.offsetTop - 25;
+ cookiesList.style.height = height + 'px';
+ },
};
// CookiesViewHandler callbacks.
« no previous file with comments | « chrome/browser/resources/options/cookies_view.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698