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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 2875193002: DevTools: update text inputs to new style (Closed)
Patch Set: rebase over cleanup Created 3 years, 6 months 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 unified diff | Download patch
OLDNEW
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
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', 'default-input');
pfeldman 2017/06/01 21:16:56 Maybe create a UI.createInput method for input tha
luoe 2017/06/06 00:16:27 Done.
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698