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

Side by Side Diff: chrome/browser/resources/settings/settings_main/settings_main.js

Issue 2382603002: MD Settings: shrink overscroll on resize (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 5 /**
6 * @typedef {{about: boolean, basic: boolean, advanced: boolean}} 6 * @typedef {{about: boolean, basic: boolean, advanced: boolean}}
7 */ 7 */
8 var MainPageVisibility; 8 var MainPageVisibility;
9 9
10 /** 10 /**
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 }.bind(this)); 96 }.bind(this));
97 97
98 var currentRoute = settings.getCurrentRoute(); 98 var currentRoute = settings.getCurrentRoute();
99 this.hasExpandedSection_ = currentRoute && currentRoute.isSubpage(); 99 this.hasExpandedSection_ = currentRoute && currentRoute.isSubpage();
100 }, 100 },
101 101
102 /** @private */ 102 /** @private */
103 overscrollChanged_: function() { 103 overscrollChanged_: function() {
104 if (!this.overscroll_ && this.boundScroll_) { 104 if (!this.overscroll_ && this.boundScroll_) {
105 this.offsetParent.removeEventListener('scroll', this.boundScroll_); 105 this.offsetParent.removeEventListener('scroll', this.boundScroll_);
106 window.removeEventListener('resize', this.boundScroll_);
106 this.boundScroll_ = null; 107 this.boundScroll_ = null;
107 } else if (this.overscroll_ && !this.boundScroll_) { 108 } else if (this.overscroll_ && !this.boundScroll_) {
108 this.boundScroll_ = function() { 109 this.boundScroll_ = function() {
109 if (!this.ignoreScroll_) 110 if (!this.ignoreScroll_)
110 this.setOverscroll_(0); 111 this.setOverscroll_(0);
111 }.bind(this); 112 }.bind(this);
112 this.offsetParent.addEventListener('scroll', this.boundScroll_); 113 this.offsetParent.addEventListener('scroll', this.boundScroll_);
114 window.addEventListener('resize', this.boundScroll_);
113 } 115 }
114 }, 116 },
115 117
116 /** 118 /**
117 * Sets the overscroll padding. Never forces a scroll, i.e., always leaves 119 * Sets the overscroll padding. Never forces a scroll, i.e., always leaves
118 * any currently visible overflow as-is. 120 * any currently visible overflow as-is.
119 * @param {number=} opt_minHeight The minimum overscroll height needed. 121 * @param {number=} opt_minHeight The minimum overscroll height needed.
120 * @private 122 * @private
121 */ 123 */
122 setOverscroll_: function(opt_minHeight) { 124 setOverscroll_: function(opt_minHeight) {
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 365
364 /** 366 /**
365 * @param {(boolean|undefined)} visibility 367 * @param {(boolean|undefined)} visibility
366 * @return {boolean} True unless visibility is false. 368 * @return {boolean} True unless visibility is false.
367 * @private 369 * @private
368 */ 370 */
369 showAdvancedSettings_: function(visibility) { 371 showAdvancedSettings_: function(visibility) {
370 return visibility !== false; 372 return visibility !== false;
371 }, 373 },
372 }); 374 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698