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

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

Issue 2980063002: DevTools: allow colorpicker to scroll horizontally (Closed)
Patch Set: no important Created 3 years, 5 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 UI.GlassPane = class { 5 UI.GlassPane = class {
6 constructor() { 6 constructor() {
7 this._widget = new UI.Widget(true); 7 this._widget = new UI.Widget(true);
8 this._widget.markAsRoot(); 8 this._widget.markAsRoot();
9 this.element = this._widget.element; 9 this.element = this._widget.element;
10 this.contentElement = this._widget.contentElement; 10 this.contentElement = this._widget.contentElement;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return; 152 return;
153 this._onClickOutsideCallback.call(null, event); 153 this._onClickOutsideCallback.call(null, event);
154 } 154 }
155 155
156 _positionContent() { 156 _positionContent() {
157 if (!this.isShowing()) 157 if (!this.isShowing())
158 return; 158 return;
159 159
160 var showArrow = this._marginBehavior === UI.GlassPane.MarginBehavior.Arrow; 160 var showArrow = this._marginBehavior === UI.GlassPane.MarginBehavior.Arrow;
161 var gutterSize = showArrow ? 8 : (this._marginBehavior === UI.GlassPane.Marg inBehavior.NoMargin ? 0 : 3); 161 var gutterSize = showArrow ? 8 : (this._marginBehavior === UI.GlassPane.Marg inBehavior.NoMargin ? 0 : 3);
162 var scrollbarSize = 14; 162 var scrollbarSize = 15;
luoe 2017/07/18 20:49:08 Measured on Linux, manually tested on Mac and Wind
163 var arrowSize = 10; 163 var arrowSize = 10;
164 164
165 var container = UI.GlassPane._containers.get(/** @type {!Document} */ (this. element.ownerDocument)); 165 var container = UI.GlassPane._containers.get(/** @type {!Document} */ (this. element.ownerDocument));
166 if (this._sizeBehavior === UI.GlassPane.SizeBehavior.MeasureContent) { 166 if (this._sizeBehavior === UI.GlassPane.SizeBehavior.MeasureContent) {
167 this.contentElement.positionAt(0, 0); 167 this.contentElement.positionAt(0, 0);
168 this.contentElement.style.width = ''; 168 this.contentElement.style.width = '';
169 this.contentElement.style.maxWidth = ''; 169 this.contentElement.style.maxWidth = '';
170 this.contentElement.style.height = ''; 170 this.contentElement.style.height = '';
171 this.contentElement.style.maxHeight = ''; 171 this.contentElement.style.maxHeight = '';
172 } 172 }
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 UI.GlassPane.MarginBehavior = { 386 UI.GlassPane.MarginBehavior = {
387 Arrow: Symbol('Arrow'), 387 Arrow: Symbol('Arrow'),
388 DefaultMargin: Symbol('DefaultMargin'), 388 DefaultMargin: Symbol('DefaultMargin'),
389 NoMargin: Symbol('NoMargin') 389 NoMargin: Symbol('NoMargin')
390 }; 390 };
391 391
392 /** @type {!Map<!Document, !Element>} */ 392 /** @type {!Map<!Document, !Element>} */
393 UI.GlassPane._containers = new Map(); 393 UI.GlassPane._containers = new Map();
394 /** @type {!Set<!UI.GlassPane>} */ 394 /** @type {!Set<!UI.GlassPane>} */
395 UI.GlassPane._panes = new Set(); 395 UI.GlassPane._panes = new Set();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698