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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/ListControl.js

Issue 2607103004: DevTools: Make sure a horizontal scrollbar doesn't appear in SuggestBox (Closed)
Patch Set: Move overflow hidden to client Created 3 years, 11 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 | third_party/WebKit/Source/devtools/front_end/ui/suggestBox.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 * @template T 6 * @template T
7 * @interface 7 * @interface
8 */ 8 */
9 UI.ListDelegate = function() {}; 9 UI.ListDelegate = function() {};
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 /** 47 /**
48 * @template T 48 * @template T
49 */ 49 */
50 UI.ListControl = class { 50 UI.ListControl = class {
51 /** 51 /**
52 * @param {!UI.ListDelegate<T>} delegate 52 * @param {!UI.ListDelegate<T>} delegate
53 * @param {!UI.ListMode=} mode 53 * @param {!UI.ListMode=} mode
54 */ 54 */
55 constructor(delegate, mode) { 55 constructor(delegate, mode) {
56 this.element = createElement('div'); 56 this.element = createElement('div');
57 this.element.style.overflow = 'auto'; 57 this.element.style.overflowY = 'auto';
58 this._topElement = this.element.createChild('div'); 58 this._topElement = this.element.createChild('div');
59 this._bottomElement = this.element.createChild('div'); 59 this._bottomElement = this.element.createChild('div');
60 this._firstIndex = 0; 60 this._firstIndex = 0;
61 this._lastIndex = 0; 61 this._lastIndex = 0;
62 this._renderedHeight = 0; 62 this._renderedHeight = 0;
63 this._topHeight = 0; 63 this._topHeight = 0;
64 this._bottomHeight = 0; 64 this._bottomHeight = 0;
65 65
66 /** @type {!Array<T>} */ 66 /** @type {!Array<T>} */
67 this._items = []; 67 this._items = [];
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 this._firstIndex = firstIndex; 589 this._firstIndex = firstIndex;
590 this._lastIndex = lastIndex; 590 this._lastIndex = lastIndex;
591 this._topHeight = this._offsetAtIndex(firstIndex); 591 this._topHeight = this._offsetAtIndex(firstIndex);
592 this._topElement.style.height = this._topHeight + 'px'; 592 this._topElement.style.height = this._topHeight + 'px';
593 this._bottomHeight = totalHeight - this._offsetAtIndex(lastIndex); 593 this._bottomHeight = totalHeight - this._offsetAtIndex(lastIndex);
594 this._bottomElement.style.height = this._bottomHeight + 'px'; 594 this._bottomElement.style.height = this._bottomHeight + 'px';
595 this._renderedHeight = totalHeight; 595 this._renderedHeight = totalHeight;
596 this.element.scrollTop = scrollTop; 596 this.element.scrollTop = scrollTop;
597 } 597 }
598 }; 598 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/suggestBox.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698