| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 * @param {number} index | 966 * @param {number} index |
| 967 */ | 967 */ |
| 968 _jumpToMatch(index) { | 968 _jumpToMatch(index) { |
| 969 if (!this._regexMatchRanges.length) | 969 if (!this._regexMatchRanges.length) |
| 970 return; | 970 return; |
| 971 | 971 |
| 972 var matchRange; | 972 var matchRange; |
| 973 if (this._currentMatchRangeIndex >= 0) { | 973 if (this._currentMatchRangeIndex >= 0) { |
| 974 matchRange = this._regexMatchRanges[this._currentMatchRangeIndex]; | 974 matchRange = this._regexMatchRanges[this._currentMatchRangeIndex]; |
| 975 var message = this._visibleViewMessages[matchRange.messageIndex]; | 975 var message = this._visibleViewMessages[matchRange.messageIndex]; |
| 976 message.searchHighlightNode(matchRange.matchIndex).classList.remove(UI.hig
hlightedCurrentSearchResultClassName); | 976 message.searchHighlightNodes(matchRange.matchIndex).forEach(node => { |
| 977 node.classList.remove(UI.highlightedCurrentSearchResultClassName); |
| 978 }); |
| 977 } | 979 } |
| 978 | 980 |
| 979 index = mod(index, this._regexMatchRanges.length); | 981 index = mod(index, this._regexMatchRanges.length); |
| 980 this._currentMatchRangeIndex = index; | 982 this._currentMatchRangeIndex = index; |
| 981 this._searchableView.updateCurrentMatchIndex(index); | 983 this._searchableView.updateCurrentMatchIndex(index); |
| 982 matchRange = this._regexMatchRanges[index]; | 984 matchRange = this._regexMatchRanges[index]; |
| 983 var message = this._visibleViewMessages[matchRange.messageIndex]; | 985 var message = this._visibleViewMessages[matchRange.messageIndex]; |
| 984 var highlightNode = message.searchHighlightNode(matchRange.matchIndex); | 986 var highlightNodes = message.searchHighlightNodes(matchRange.matchIndex); |
| 985 highlightNode.classList.add(UI.highlightedCurrentSearchResultClassName); | 987 highlightNodes.forEach((node, idx) => { |
| 988 node.classList.add(UI.highlightedCurrentSearchResultClassName); |
| 989 }); |
| 986 this._viewport.scrollItemIntoView(matchRange.messageIndex); | 990 this._viewport.scrollItemIntoView(matchRange.messageIndex); |
| 987 highlightNode.scrollIntoViewIfNeeded(); | 991 highlightNodes[0].scrollIntoViewIfNeeded(); |
| 988 } | 992 } |
| 989 | 993 |
| 990 _updateStickToBottomOnMouseDown() { | 994 _updateStickToBottomOnMouseDown() { |
| 991 this._muteViewportUpdates = true; | 995 this._muteViewportUpdates = true; |
| 992 this._viewport.setStickToBottom(false); | 996 this._viewport.setStickToBottom(false); |
| 993 if (this._waitForScrollTimeout) { | 997 if (this._waitForScrollTimeout) { |
| 994 clearTimeout(this._waitForScrollTimeout); | 998 clearTimeout(this._waitForScrollTimeout); |
| 995 delete this._waitForScrollTimeout; | 999 delete this._waitForScrollTimeout; |
| 996 } | 1000 } |
| 997 } | 1001 } |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 return true; | 1339 return true; |
| 1336 } | 1340 } |
| 1337 return false; | 1341 return false; |
| 1338 } | 1342 } |
| 1339 }; | 1343 }; |
| 1340 | 1344 |
| 1341 /** | 1345 /** |
| 1342 * @typedef {{messageIndex: number, matchIndex: number}} | 1346 * @typedef {{messageIndex: number, matchIndex: number}} |
| 1343 */ | 1347 */ |
| 1344 Console.ConsoleView.RegexMatchRange; | 1348 Console.ConsoleView.RegexMatchRange; |
| OLD | NEW |