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

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

Issue 1397403003: [DevTools] Remove HelpScreen, turn SettingsScreen into dialog and web component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screens
Patch Set: rebased Created 5 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 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 ee9cc15b912ed0aa0c95aab3de7d38c16412c7ae..5662a50e6e530103249252898d7a542848134030 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -204,7 +204,8 @@ WebInspector.GlassPane = function(document, dimmed)
{
this.element = createElement("div");
var background = dimmed ? "rgba(255, 255, 255, 0.5)" : "transparent";
- this.element.style.cssText = "position:absolute;top:0;bottom:0;left:0;right:0;background-color:" + background + ";z-index:3000;overflow:hidden;";
+ this._zIndex = WebInspector._glassPane ? WebInspector._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);
WebInspector._glassPane = this;
}
@@ -219,6 +220,9 @@ WebInspector.GlassPane.prototype = {
}
}
+/** @type {!WebInspector.GlassPane|undefined} */
+WebInspector._glassPane;
+
/**
* @type {!Array.<!WebInspector.Widget|!WebInspector.Dialog>}
*/
@@ -771,17 +775,17 @@ WebInspector.setCurrentFocusElement = function(x)
WebInspector._previousFocusElement = WebInspector._currentFocusElement;
WebInspector._currentFocusElement = x;
- if (WebInspector._currentFocusElement) {
- WebInspector._currentFocusElement.focus();
+ if (x) {
+ x.focus();
// Make a caret selection inside the new element if there isn't a range selection and there isn't already a caret selection inside.
// This is needed (at least) to remove caret from console when focus is moved to some element in the panel.
// The code below should not be applied to text fields and text areas, hence _isTextEditingElement check.
var selection = x.getComponentSelection();
- if (!WebInspector._isTextEditingElement(WebInspector._currentFocusElement) && selection.isCollapsed && !WebInspector._currentFocusElement.isInsertionCaretInside()) {
- var selectionRange = WebInspector._currentFocusElement.ownerDocument.createRange();
- selectionRange.setStart(WebInspector._currentFocusElement, 0);
- selectionRange.setEnd(WebInspector._currentFocusElement, 0);
+ if (!WebInspector._isTextEditingElement(x) && selection.isCollapsed && !x.isInsertionCaretInside()) {
+ var selectionRange = x.ownerDocument.createRange();
+ selectionRange.setStart(x, 0);
+ selectionRange.setEnd(x, 0);
selection.removeAllRanges();
selection.addRange(selectionRange);

Powered by Google App Engine
This is Rietveld 408576698