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

Unified Diff: Source/devtools/front_end/StyleSheetOutlineDialog.js

Issue 77283005: DevTools: refactor outline dialogs to run callback on item selection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « Source/devtools/front_end/SourcesPanel.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/StyleSheetOutlineDialog.js
diff --git a/Source/devtools/front_end/StyleSheetOutlineDialog.js b/Source/devtools/front_end/StyleSheetOutlineDialog.js
index 4c396470a155dd6b97895490f59a7898f1b5c893..5519a092a9d370287e779bf2a13723c13bfd4a33 100644
--- a/Source/devtools/front_end/StyleSheetOutlineDialog.js
+++ b/Source/devtools/front_end/StyleSheetOutlineDialog.js
@@ -31,11 +31,12 @@
* @extends {WebInspector.SelectionDialogContentProvider}
* @param {WebInspector.View} view
* @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {function(number, number)} selectItemCallback
*/
-WebInspector.StyleSheetOutlineDialog = function(view, uiSourceCode)
+WebInspector.StyleSheetOutlineDialog = function(view, uiSourceCode, selectItemCallback)
{
WebInspector.SelectionDialogContentProvider.call(this);
-
+ this._selectItemCallback = selectItemCallback;
this._rules = [];
this._view = view;
this._uiSourceCode = uiSourceCode;
@@ -45,12 +46,13 @@ WebInspector.StyleSheetOutlineDialog = function(view, uiSourceCode)
/**
* @param {WebInspector.View} view
* @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {function(number, number)} selectItemCallback
*/
-WebInspector.StyleSheetOutlineDialog.show = function(view, uiSourceCode)
+WebInspector.StyleSheetOutlineDialog.show = function(view, uiSourceCode, selectItemCallback)
{
if (WebInspector.Dialog.currentInstance())
return null;
- var delegate = new WebInspector.StyleSheetOutlineDialog(view, uiSourceCode);
+ var delegate = new WebInspector.StyleSheetOutlineDialog(view, uiSourceCode, selectItemCallback);
var filteredItemSelectionDialog = new WebInspector.FilteredItemSelectionDialog(delegate);
WebInspector.Dialog.show(view.element, filteredItemSelectionDialog);
}
@@ -138,8 +140,7 @@ WebInspector.StyleSheetOutlineDialog.prototype = {
var rule = this._rules[itemIndex];
var lineNumber = rule.rawLocation.lineNumber;
if (!isNaN(lineNumber) && lineNumber >= 0)
- this._view.highlightPosition(lineNumber, rule.rawLocation.columnNumber);
- this._view.focus();
+ this._selectItemCallback(lineNumber, rule.rawLocation.columnNumber);
},
__proto__: WebInspector.SelectionDialogContentProvider.prototype
« no previous file with comments | « Source/devtools/front_end/SourcesPanel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698