OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * | 10 * |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 /** | 87 /** |
88 * @override | 88 * @override |
89 * @param {number} itemIndex | 89 * @param {number} itemIndex |
90 * @param {string} query | 90 * @param {string} query |
91 * @param {!Element} titleElement | 91 * @param {!Element} titleElement |
92 * @param {!Element} subtitleElement | 92 * @param {!Element} subtitleElement |
93 */ | 93 */ |
94 renderItem(itemIndex, query, titleElement, subtitleElement) { | 94 renderItem(itemIndex, query, titleElement, subtitleElement) { |
95 var rule = this._rules[itemIndex]; | 95 var rule = this._rules[itemIndex]; |
96 titleElement.textContent = rule.selectorText || rule.atRule; | 96 titleElement.textContent = rule.selectorText || rule.atRule; |
97 this.highlightRanges(titleElement, query); | 97 QuickOpen.FilteredListWidget.highlightRanges(titleElement, query); |
98 subtitleElement.textContent = ':' + (rule.lineNumber + 1); | 98 subtitleElement.textContent = ':' + (rule.lineNumber + 1); |
99 } | 99 } |
100 | 100 |
101 /** | 101 /** |
102 * @override | 102 * @override |
103 * @param {?number} itemIndex | 103 * @param {?number} itemIndex |
104 * @param {string} promptValue | 104 * @param {string} promptValue |
105 */ | 105 */ |
106 selectItem(itemIndex, promptValue) { | 106 selectItem(itemIndex, promptValue) { |
107 if (itemIndex === null) | 107 if (itemIndex === null) |
108 return; | 108 return; |
109 var rule = this._rules[itemIndex]; | 109 var rule = this._rules[itemIndex]; |
110 var lineNumber = rule.lineNumber; | 110 var lineNumber = rule.lineNumber; |
111 if (!isNaN(lineNumber) && lineNumber >= 0) | 111 if (!isNaN(lineNumber) && lineNumber >= 0) |
112 this._selectItemCallback(lineNumber, rule.columnNumber); | 112 this._selectItemCallback(lineNumber, rule.columnNumber); |
113 } | 113 } |
114 }; | 114 }; |
OLD | NEW |