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

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

Issue 676193002: Navigate between individual search matches in DevTools console (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Consolidate test suites Created 6 years 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/ui/UIUtils.js
diff --git a/Source/devtools/front_end/ui/UIUtils.js b/Source/devtools/front_end/ui/UIUtils.js
index 0af658e916ff888ecacf7f537c52157f7d88faa1..1158a10c8404db99697ff7fa4f8463e7fd1671df 100644
--- a/Source/devtools/front_end/ui/UIUtils.js
+++ b/Source/devtools/front_end/ui/UIUtils.js
@@ -29,6 +29,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+WebInspector.highlightedSearchResultClassName = "highlighted-search-result";
+
/**
* @param {!Element} element
* @param {?function(!MouseEvent): boolean} elementDragStart
@@ -799,15 +801,16 @@ WebInspector.highlightSearchResult = function(element, offset, length, domChange
*/
WebInspector.highlightSearchResults = function(element, resultRanges, changes)
{
- return WebInspector.highlightRangesWithStyleClass(element, resultRanges, "highlighted-search-result", changes);
+ return WebInspector.highlightRangesWithStyleClass(element, resultRanges, WebInspector.highlightedSearchResultClassName, changes);
}
/**
* @param {!Element} element
+ * @param {string} styleClass
*/
-WebInspector.removeSearchResultsHighlight = function(element)
+WebInspector.removeSearchResultsHighlight = function(element, styleClass)
{
- var highlightBits = element.querySelectorAll(".highlighted-search-result");
+ var highlightBits = element.querySelectorAll("." + styleClass);
for (var i = 0; i < highlightBits.length; ++i) {
var span = highlightBits[i];
span.parentElement.replaceChild(createTextNode(span.textContent), span);

Powered by Google App Engine
This is Rietveld 408576698