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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 UI.ToolbarInput = class extends UI.ToolbarItem { 558 UI.ToolbarInput = class extends UI.ToolbarItem {
559 /** 559 /**
560 * @param {string} placeholder 560 * @param {string} placeholder
561 * @param {number=} growFactor 561 * @param {number=} growFactor
562 * @param {number=} shrinkFactor 562 * @param {number=} shrinkFactor
563 * @param {boolean=} isSearchField 563 * @param {boolean=} isSearchField
564 */ 564 */
565 constructor(placeholder, growFactor, shrinkFactor, isSearchField) { 565 constructor(placeholder, growFactor, shrinkFactor, isSearchField) {
566 super(createElementWithClass('div', 'toolbar-input')); 566 super(createElementWithClass('div', 'toolbar-input'));
567 567
568 this.input = this.element.createChild('input'); 568 this.input = this.element.createChild('input', 'default-input');
569 this.input.addEventListener('focus', () => this.element.classList.add('focus ed')); 569 this.input.addEventListener('focus', () => this.element.classList.add('focus ed'));
570 this.input.addEventListener('blur', () => this.element.classList.remove('foc used')); 570 this.input.addEventListener('blur', () => this.element.classList.remove('foc used'));
571 this.input.addEventListener('input', () => this._onChangeCallback(), false); 571 this.input.addEventListener('input', () => this._onChangeCallback(), false);
572 this._isSearchField = !!isSearchField; 572 this._isSearchField = !!isSearchField;
573 if (growFactor) 573 if (growFactor)
574 this.element.style.flexGrow = growFactor; 574 this.element.style.flexGrow = growFactor;
575 if (shrinkFactor) 575 if (shrinkFactor)
576 this.element.style.flexShrink = shrinkFactor; 576 this.element.style.flexShrink = shrinkFactor;
577 if (placeholder) 577 if (placeholder)
578 this.input.setAttribute('placeholder', placeholder); 578 this.input.setAttribute('placeholder', placeholder);
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 /** 1061 /**
1062 * @param {!Common.Setting} setting 1062 * @param {!Common.Setting} setting
1063 * @param {string=} tooltip 1063 * @param {string=} tooltip
1064 * @param {string=} alternateTitle 1064 * @param {string=} alternateTitle
1065 */ 1065 */
1066 constructor(setting, tooltip, alternateTitle) { 1066 constructor(setting, tooltip, alternateTitle) {
1067 super(alternateTitle || setting.title() || '', tooltip); 1067 super(alternateTitle || setting.title() || '', tooltip);
1068 UI.SettingsUI.bindCheckbox(this.inputElement, setting); 1068 UI.SettingsUI.bindCheckbox(this.inputElement, setting);
1069 } 1069 }
1070 }; 1070 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698