| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 return false; | 114 return false; |
| 115 } | 115 } |
| 116 | 116 |
| 117 /** | 117 /** |
| 118 * @param {string} placeholder | 118 * @param {string} placeholder |
| 119 * @param {!Element} container | 119 * @param {!Element} container |
| 120 * @param {function(?RegExp)} filterCallback | 120 * @param {function(?RegExp)} filterCallback |
| 121 * @return {!Element} | 121 * @return {!Element} |
| 122 */ | 122 */ |
| 123 static createPropertyFilterElement(placeholder, container, filterCallback) { | 123 static createPropertyFilterElement(placeholder, container, filterCallback) { |
| 124 var input = createElement('input'); | 124 var input = createElementWithClass('input'); |
| 125 input.placeholder = placeholder; | 125 input.placeholder = placeholder; |
| 126 | 126 |
| 127 function searchHandler() { | 127 function searchHandler() { |
| 128 var regex = input.value ? new RegExp(input.value.escapeForRegExp(), 'i') :
null; | 128 var regex = input.value ? new RegExp(input.value.escapeForRegExp(), 'i') :
null; |
| 129 filterCallback(regex); | 129 filterCallback(regex); |
| 130 container.classList.toggle('styles-filter-engaged', !!input.value); | 130 container.classList.toggle('styles-filter-engaged', !!input.value); |
| 131 } | 131 } |
| 132 input.addEventListener('input', searchHandler, false); | 132 input.addEventListener('input', searchHandler, false); |
| 133 | 133 |
| 134 /** | 134 /** |
| (...skipping 3007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3142 } | 3142 } |
| 3143 | 3143 |
| 3144 /** | 3144 /** |
| 3145 * @override | 3145 * @override |
| 3146 * @return {!UI.ToolbarItem} | 3146 * @return {!UI.ToolbarItem} |
| 3147 */ | 3147 */ |
| 3148 item() { | 3148 item() { |
| 3149 return this._button; | 3149 return this._button; |
| 3150 } | 3150 } |
| 3151 }; | 3151 }; |
| OLD | NEW |