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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2658383002: [DevTools] Make UI.GlassPane position contentElement for different overlay controls. (Closed)
Patch Set: rebased 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
index 1e79d2231cf554d764e8a278a30592c07fd4a2f5..02e9c831219b841b7b80ec819a657b18a183a332 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -94,8 +94,11 @@ UI.DragHandler = class {
_createGlassPane() {
this._glassPaneInUse = true;
- if (!UI.DragHandler._glassPaneUsageCount++)
- UI.DragHandler._glassPane = new UI.GlassPane(UI.DragHandler._documentForMouseOut);
+ if (!UI.DragHandler._glassPaneUsageCount++) {
+ UI.DragHandler._glassPane = new UI.GlassPane(
+ UI.DragHandler._documentForMouseOut, false /* dimmed */, true /* blockPointerEvents */, event => {});
+ UI.DragHandler._glassPane.show();
+ }
}
_disposeGlassPane() {
@@ -104,7 +107,7 @@ UI.DragHandler = class {
this._glassPaneInUse = false;
if (--UI.DragHandler._glassPaneUsageCount)
return;
- UI.DragHandler._glassPane.dispose();
+ UI.DragHandler._glassPane.hide();
delete UI.DragHandler._glassPane;
delete UI.DragHandler._documentForMouseOut;
}
@@ -299,35 +302,6 @@ UI.installInertialDragHandle = function(
};
/**
- * @unrestricted
- */
-UI.GlassPane = class {
- /**
- * @param {!Document} document
- * @param {boolean=} dimmed
- */
- constructor(document, dimmed) {
- this.element = createElement('div');
- var background = dimmed ? 'rgba(255, 255, 255, 0.5)' : 'transparent';
- this._zIndex = UI._glassPane ? UI._glassPane._zIndex + 1000 :
- 3000; // Deliberately starts with 3000 to hide other z-indexed elements below.
- this.element.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;background-color:' + background +
- ';z-index:' + this._zIndex + ';overflow:hidden;';
- document.body.appendChild(this.element);
- UI._glassPane = this;
- // TODO(dgozman): disallow focus outside of glass pane?
- }
-
- dispose() {
- delete UI._glassPane;
- this.element.remove();
- }
-};
-
-/** @type {!UI.GlassPane|undefined} */
-UI._glassPane;
-
-/**
* @param {?Node=} node
* @return {boolean}
*/
@@ -1217,6 +1191,7 @@ UI.initializeUIUtils = function(document, themeSetting) {
var body = /** @type {!Element} */ (document.body);
UI.appendStyle(body, 'ui/inspectorStyle.css');
UI.appendStyle(body, 'ui/popover.css');
+ UI.GlassPane.setContainer(/** @type {!Element} */ (document.body));
};
/**
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/Tooltip.js ('k') | third_party/WebKit/Source/devtools/front_end/ui/dialog.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698