Chromium Code Reviews| Index: chrome/browser/resources/md_history/searched_label.js |
| diff --git a/chrome/browser/resources/md_history/searched_label.js b/chrome/browser/resources/md_history/searched_label.js |
| index 3eeffb123f59c20e38395d9dfa0aa4230e32b0cd..c22803c205e60c96bf1d39924b63f297a195f41f 100644 |
| --- a/chrome/browser/resources/md_history/searched_label.js |
| +++ b/chrome/browser/resources/md_history/searched_label.js |
| @@ -22,29 +22,28 @@ Polymer({ |
| */ |
| setSearchedTextToBold_: function() { |
| var i = 0; |
| - var titleElem = this.$.container; |
| var titleText = this.title; |
| if (this.searchTerm == '' || this.searchTerm == null) { |
| - titleElem.textContent = titleText; |
| + this.textContent = titleText; |
| return; |
| } |
| var re = new RegExp(quoteString(this.searchTerm), 'gim'); |
| var match; |
| - titleElem.textContent = ''; |
| + this.textContent = ''; |
| while (match = re.exec(titleText)) { |
| if (match.index > i) |
|
Dan Beam
2016/09/06 15:54:32
nit: curlies
|
| - titleElem.appendChild(document.createTextNode( |
| + this.appendChild(document.createTextNode( |
| titleText.slice(i, match.index))); |
| i = re.lastIndex; |
| // Mark the highlighted text in bold. |
| var b = document.createElement('b'); |
| b.textContent = titleText.substring(match.index, i); |
| - titleElem.appendChild(b); |
| + this.appendChild(b); |
| } |
| if (i < titleText.length) |
| - titleElem.appendChild( |
| + this.appendChild( |
|
Dan Beam
2016/09/06 15:54:32
nit: curlies
|
| document.createTextNode(titleText.slice(i))); |
| }, |
| }); |