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

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

Issue 202043002: DevTools: Use open resource dialog for go to line feature in sources panel. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 9 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: Source/devtools/front_end/FilteredItemSelectionDialog.js
diff --git a/Source/devtools/front_end/FilteredItemSelectionDialog.js b/Source/devtools/front_end/FilteredItemSelectionDialog.js
index d3eb69f5da6c2bd8a43c4d83e7438a5ace8b015d..8ec216620045db15878016c7a9c096edcd3d6c0a 100644
--- a/Source/devtools/front_end/FilteredItemSelectionDialog.js
+++ b/Source/devtools/front_end/FilteredItemSelectionDialog.js
@@ -63,8 +63,6 @@ WebInspector.FilteredItemSelectionDialog = function(delegate)
this._delegate = delegate;
this._delegate.setRefreshCallback(this._itemsLoaded.bind(this));
this._itemsLoaded();
-
- this._shouldShowMatchingItems = true;
}
WebInspector.FilteredItemSelectionDialog.prototype = {
@@ -252,17 +250,25 @@ WebInspector.FilteredItemSelectionDialog.prototype = {
}
},
+ /**
+ * @return {boolean}
+ */
+ _shouldShowMatchingItems: function()
+ {
+ return this._delegate.shouldShowMatchingItems(this._promptElement.value);
+ },
+
_onInput: function(event)
{
- this._shouldShowMatchingItems = this._delegate.shouldShowMatchingItems(this._promptElement.value);
this._updateShowMatchingItems();
this._scheduleFilter();
},
_updateShowMatchingItems: function()
{
- this._itemElementsContainer.classList.toggle("hidden", !this._shouldShowMatchingItems);
- this.element.style.height = this._shouldShowMatchingItems ? this._dialogHeight + "px" : "auto";
+ var shouldShowMatchingItems = this._shouldShowMatchingItems();
+ this._itemElementsContainer.classList.toggle("hidden", !shouldShowMatchingItems);
+ this.element.style.height = shouldShowMatchingItems ? this._dialogHeight + "px" : "auto";
},
_onKeyDown: function(event)
@@ -811,18 +817,18 @@ WebInspector.OpenResourceDialog.prototype = {
/**
* @param {!WebInspector.SourcesPanel} panel
* @param {!Element} relativeToElement
- * @param {string=} name
+ * @param {string=} query
* @param {!Map.<!WebInspector.UISourceCode, number>=} defaultScores
*/
-WebInspector.OpenResourceDialog.show = function(panel, relativeToElement, name, defaultScores)
+WebInspector.OpenResourceDialog.show = function(panel, relativeToElement, query, defaultScores)
{
if (WebInspector.Dialog.currentInstance())
return;
var filteredItemSelectionDialog = new WebInspector.FilteredItemSelectionDialog(new WebInspector.OpenResourceDialog(panel, defaultScores));
filteredItemSelectionDialog.renderAsTwoRows();
- if (name)
- filteredItemSelectionDialog.setQuery(name);
+ if (query)
+ filteredItemSelectionDialog.setQuery(query);
WebInspector.Dialog.show(relativeToElement, filteredItemSelectionDialog);
}
« no previous file with comments | « LayoutTests/inspector/jump-to-previous-editing-location.html ('k') | Source/devtools/front_end/GoToLineDialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698