Title: [112684] branches/chromium/1084/Source/WebCore/inspector/front-end
- Revision
- 112684
- Author
- vse...@chromium.org
- Date
- 2012-03-30 10:27:02 -0700 (Fri, 30 Mar 2012)
Log Message
Merge 112677 - Web Inspector: ScriptsNavigator scripts selection/focus polish.
https://bugs.webkit.org/show_bug.cgi?id=82732
Reviewed by Pavel Feldman.
Script could be selected by space in ScriptsNavigator now.
This patch also polishes focus behavior when using ScriptsNavigator.
* inspector/front-end/ScriptsNavigator.js:
(WebInspector.ScriptsNavigator.prototype._scriptSelected): Added focusSource param to give clients possibility to release focus.
(WebInspector.NavigatorScriptTreeElement.prototype.onspace): Added script selection on space pressed.
(WebInspector.NavigatorScriptTreeElement.prototype._onclick):
(WebInspector.NavigatorScriptTreeElement.prototype.onenter):
* inspector/front-end/ScriptsPanel.js: _hideNavigatorOverlay moved to the end of events processing to set focus correctly.
(WebInspector.ScriptsPanel.prototype._editorSelected):
(WebInspector.ScriptsPanel.prototype._fileSelected):
(WebInspector.ScriptsPanel.prototype._hideNavigatorOverlay):
* inspector/front-end/treeoutline.js:
(TreeOutline.prototype._treeKeyDown): onspace event added.
TBR=vse...@chromium.org
BUG=121133
Review URL: https://chromiumcodereview.appspot.com/9956025
Modified Paths
Diff
Modified: branches/chromium/1084/Source/WebCore/inspector/front-end/ScriptsNavigator.js (112683 => 112684)
--- branches/chromium/1084/Source/WebCore/inspector/front-end/ScriptsNavigator.js 2012-03-30 17:17:03 UTC (rev 112683)
+++ branches/chromium/1084/Source/WebCore/inspector/front-end/ScriptsNavigator.js 2012-03-30 17:27:02 UTC (rev 112684)
@@ -219,11 +219,14 @@
/**
* @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {boolean} focusSource
*/
- scriptSelected: function(uiSourceCode)
+ _scriptSelected: function(uiSourceCode, focusSource)
{
this._lastSelectedUISourceCode = uiSourceCode;
this.dispatchEventToListeners(WebInspector.ScriptsPanel.FileSelector.Events.FileSelected, uiSourceCode);
+ if (focusSource)
+ this.dispatchEventToListeners(WebInspector.ScriptsPanel.FileSelector.Events.ReleasedFocusAfterSelection, uiSourceCode);
},
/**
@@ -575,17 +578,24 @@
this.listItemElement.addEventListener("click", this._onclick.bind(this), false);
},
+ onspace: function()
+ {
+ this._navigator._scriptSelected(this.uiSourceCode, true);
+ return true;
+ },
+
/**
* @param {Event} event
*/
_onclick: function(event)
{
- this._navigator.scriptSelected(this.uiSourceCode);
+ this._navigator._scriptSelected(this.uiSourceCode, false);
},
onenter: function()
{
- this._navigator.scriptSelected(this.uiSourceCode);
+ this._navigator._scriptSelected(this.uiSourceCode, true);
+ return true;
}
}
Modified: branches/chromium/1084/Source/WebCore/inspector/front-end/ScriptsPanel.js (112683 => 112684)
--- branches/chromium/1084/Source/WebCore/inspector/front-end/ScriptsPanel.js 2012-03-30 17:17:03 UTC (rev 112683)
+++ branches/chromium/1084/Source/WebCore/inspector/front-end/ScriptsPanel.js 2012-03-30 17:27:02 UTC (rev 112684)
@@ -673,16 +673,16 @@
_editorSelected: function(event)
{
- this._hideNavigatorOverlay();
var uiSourceCode = /** @type {WebInspector.UISourceCode} */ event.data;
this._showFile(uiSourceCode);
+ this._hideNavigatorOverlay();
},
_fileSelected: function(event)
{
- this._hideNavigatorOverlay();
var uiSourceCode = /** @type {WebInspector.UISourceCode} */ event.data;
this._showFile(uiSourceCode);
+ this._hideNavigatorOverlay();
},
_fileSelectorReleasedFocus: function(event)
@@ -1049,6 +1049,8 @@
return;
this._sidebarOverlay.hide();
+ if (this.visibleView)
+ this.visibleView.focus();
},
_navigatorOverlayWasShown: function(event)
Modified: branches/chromium/1084/Source/WebCore/inspector/front-end/treeoutline.js (112683 => 112684)
--- branches/chromium/1084/Source/WebCore/inspector/front-end/treeoutline.js 2012-03-30 17:17:03 UTC (rev 112683)
+++ branches/chromium/1084/Source/WebCore/inspector/front-end/treeoutline.js 2012-03-30 17:27:02 UTC (rev 112684)
@@ -409,6 +409,9 @@
} else if (isEnterKey(event)) {
if (this.selectedTreeElement.onenter)
handled = this.selectedTreeElement.onenter();
+ } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Space.code) {
+ if (this.selectedTreeElement.onspace)
+ handled = this.selectedTreeElement.onspace();
}
if (nextSelectedElement) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes