https://bugs.webkit.org/show_bug.cgi?id=76628
Reviewed by Pavel Feldman.
* inspector/front-end/Dialog.js:
(WebInspector.Dialog.prototype._hide):
* inspector/front-end/FilteredItemSelectionDialog.js:
(WebInspector.FilteredItemSelectionDialog.prototype.onEnter):
(WebInspector.JavaScriptOutlineDialog.prototype.selectItem):
* inspector/front-end/ScriptsNavigator.js:
(WebInspector.ScriptsNavigator.prototype.get defaultFocusedElement):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._showSourceLine):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105410
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2012-01-19 Vsevolod Vlasov <vsevik@chromium.org>
+ Web Inspector: Improve focus switching in scripts panel.
+ https://bugs.webkit.org/show_bug.cgi?id=76628
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/front-end/Dialog.js:
+ (WebInspector.Dialog.prototype._hide):
+ * inspector/front-end/FilteredItemSelectionDialog.js:
+ (WebInspector.FilteredItemSelectionDialog.prototype.onEnter):
+ (WebInspector.JavaScriptOutlineDialog.prototype.selectItem):
+ * inspector/front-end/ScriptsNavigator.js:
+ (WebInspector.ScriptsNavigator.prototype.get defaultFocusedElement):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._showSourceLine):
+
+2012-01-19 Vsevolod Vlasov <vsevik@chromium.org>
+
Web Inspector: Add isSelfOrAnsector and isSelfOrDescendant methods to utilities.
https://bugs.webkit.org/show_bug.cgi?id=76618
this._delegate.willHide();
- WebInspector.setCurrentFocusElement(this._previousFocusElement);
+ if (this._element.isSelfOrAncestor(document.activeElement))
+ WebInspector.setCurrentFocusElement(this._previousFocusElement);
delete WebInspector.Dialog._instance;
document.body.removeChild(this._glassPaneElement);
window.removeEventListener("resize", this._windowResizeHandler, true);
onEnter: function()
{
+ if (!this._selectedElement)
+ return;
this._delegate.selectItem(this._elementIndexes.get(this._selectedElement));
},
var lineNumber = this._functionItems[itemIndex].line;
if (!isNaN(lineNumber) && lineNumber >= 0)
this._view.highlightLine(lineNumber);
+ this._view.focus();
delete WebInspector.JavaScriptOutlineDialog._instance;
},
*/
get defaultFocusedElement()
{
- return this._navigatorScriptsTreeElement
+ return this._navigatorScriptsTreeElement;
},
/**
this._tabbedPane.selectTab(uiSourceCode.isContentScript ? WebInspector.ScriptsNavigator.ContentScriptsTab : WebInspector.ScriptsNavigator.ScriptsTab);
var scriptTreeElement = this._scriptTreeElementsByUISourceCode.get(uiSourceCode);
- scriptTreeElement.revealAndSelect();
+ scriptTreeElement.revealAndSelect(true);
},
/**
var sourceFrame = this._showAndRevealInFileSelector(uiSourceCode);
if (typeof lineNumber === "number")
sourceFrame.highlightLine(lineNumber);
+ sourceFrame.focus();
},
/**