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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js

Issue 2741863002: DevTools: Focus background in Toolbars (Closed)
Patch Set: raf Created 3 years, 9 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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 */ 828 */
829 UI.ToolbarComboBox = class extends UI.ToolbarItem { 829 UI.ToolbarComboBox = class extends UI.ToolbarItem {
830 /** 830 /**
831 * @param {?function(!Event)} changeHandler 831 * @param {?function(!Event)} changeHandler
832 * @param {string=} className 832 * @param {string=} className
833 */ 833 */
834 constructor(changeHandler, className) { 834 constructor(changeHandler, className) {
835 super(createElementWithClass('span', 'toolbar-select-container')); 835 super(createElementWithClass('span', 'toolbar-select-container'));
836 836
837 this._selectElement = this.element.createChild('select', 'toolbar-item'); 837 this._selectElement = this.element.createChild('select', 'toolbar-item');
838 this._selectElement.addEventListener('focus', () => this.element.classList.a dd('focused'));
pfeldman 2017/03/27 21:17:35 why not :focused pseudo?
einbinder 2017/03/27 23:12:59 this._selectElement has focus, but this.element ne
839 this._selectElement.addEventListener('blur', () => this.element.classList.re move('focused'));
838 var dropdownArrowIcon = UI.Icon.create('smallicon-dropdown-arrow', 'toolbar- dropdown-arrow'); 840 var dropdownArrowIcon = UI.Icon.create('smallicon-dropdown-arrow', 'toolbar- dropdown-arrow');
839 this.element.appendChild(dropdownArrowIcon); 841 this.element.appendChild(dropdownArrowIcon);
840 if (changeHandler) 842 if (changeHandler)
841 this._selectElement.addEventListener('change', changeHandler, false); 843 this._selectElement.addEventListener('change', changeHandler, false);
842 if (className) 844 if (className)
843 this._selectElement.classList.add(className); 845 this._selectElement.classList.add(className);
844 } 846 }
845 847
846 /** 848 /**
847 * @return {!HTMLSelectElement} 849 * @return {!HTMLSelectElement}
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 /** 1056 /**
1055 * @param {!Common.Setting} setting 1057 * @param {!Common.Setting} setting
1056 * @param {string=} tooltip 1058 * @param {string=} tooltip
1057 * @param {string=} alternateTitle 1059 * @param {string=} alternateTitle
1058 */ 1060 */
1059 constructor(setting, tooltip, alternateTitle) { 1061 constructor(setting, tooltip, alternateTitle) {
1060 super(alternateTitle || setting.title() || '', tooltip); 1062 super(alternateTitle || setting.title() || '', tooltip);
1061 UI.SettingsUI.bindCheckbox(this.inputElement, setting); 1063 UI.SettingsUI.bindCheckbox(this.inputElement, setting);
1062 } 1064 }
1063 }; 1065 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698