OLD | NEW |
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 }, | 327 }, |
328 | 328 |
329 /** | 329 /** |
330 * @param {boolean} dimmed | 330 * @param {boolean} dimmed |
331 */ | 331 */ |
332 setDimmed: function(dimmed) | 332 setDimmed: function(dimmed) |
333 { | 333 { |
334 this.element.classList.toggle("toolbar-dimmed", dimmed); | 334 this.element.classList.toggle("toolbar-dimmed", dimmed); |
335 }, | 335 }, |
336 | 336 |
337 addDropDownArrow: function() | |
338 { | |
339 this.element.classList.add("toolbar-has-dropdown"); | |
340 this.element.createChild("div", "toolbar-dropdown-arrow"); | |
341 }, | |
342 | |
343 __proto__: WebInspector.ToolbarItem.prototype | 337 __proto__: WebInspector.ToolbarItem.prototype |
344 } | 338 } |
345 | 339 |
346 /** | 340 /** |
347 * @constructor | 341 * @constructor |
348 * @extends {WebInspector.ToolbarLabel} | 342 * @extends {WebInspector.ToolbarLabel} |
349 * @param {string} title | 343 * @param {string} title |
350 * @param {string} glyph | 344 * @param {string} glyph |
351 */ | 345 */ |
352 WebInspector.ToolbarButton = function(title, glyph) | 346 WebInspector.ToolbarButton = function(title, glyph) |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 * @constructor | 713 * @constructor |
720 * @extends {WebInspector.ToolbarItem} | 714 * @extends {WebInspector.ToolbarItem} |
721 * @param {?function(!Event)} changeHandler | 715 * @param {?function(!Event)} changeHandler |
722 * @param {string=} className | 716 * @param {string=} className |
723 */ | 717 */ |
724 WebInspector.ToolbarComboBox = function(changeHandler, className) | 718 WebInspector.ToolbarComboBox = function(changeHandler, className) |
725 { | 719 { |
726 WebInspector.ToolbarItem.call(this, createElementWithClass("span", "toolbar-
select-container")); | 720 WebInspector.ToolbarItem.call(this, createElementWithClass("span", "toolbar-
select-container")); |
727 | 721 |
728 this._selectElement = this.element.createChild("select", "toolbar-item"); | 722 this._selectElement = this.element.createChild("select", "toolbar-item"); |
729 this.element.createChild("div", "toolbar-dropdown-arrow"); | 723 this.element.createChild("div", "toolbar-select-arrow"); |
730 if (changeHandler) | 724 if (changeHandler) |
731 this._selectElement.addEventListener("change", changeHandler, false); | 725 this._selectElement.addEventListener("change", changeHandler, false); |
732 if (className) | 726 if (className) |
733 this._selectElement.classList.add(className); | 727 this._selectElement.classList.add(className); |
734 } | 728 } |
735 | 729 |
736 WebInspector.ToolbarComboBox.prototype = { | 730 WebInspector.ToolbarComboBox.prototype = { |
737 /** | 731 /** |
738 * @return {!HTMLSelectElement} | 732 * @return {!HTMLSelectElement} |
739 */ | 733 */ |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 for (var i = 0; i < items.length; ++i) { | 930 for (var i = 0; i < items.length; ++i) { |
937 var item = items[i]; | 931 var item = items[i]; |
938 if (item) | 932 if (item) |
939 this.appendToolbarItem(item); | 933 this.appendToolbarItem(item); |
940 } | 934 } |
941 } | 935 } |
942 }, | 936 }, |
943 | 937 |
944 __proto__: WebInspector.Toolbar.prototype | 938 __proto__: WebInspector.Toolbar.prototype |
945 } | 939 } |
OLD | NEW |