| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 setState: function(state) | 343 setState: function(state) |
| 344 { | 344 { |
| 345 if (this._state === state) | 345 if (this._state === state) |
| 346 return; | 346 return; |
| 347 this.element.classList.remove("toolbar-state-" + this._state); | 347 this.element.classList.remove("toolbar-state-" + this._state); |
| 348 this.element.classList.add("toolbar-state-" + state); | 348 this.element.classList.add("toolbar-state-" + state); |
| 349 this._state = state; | 349 this._state = state; |
| 350 }, | 350 }, |
| 351 | 351 |
| 352 /** | 352 /** |
| 353 * @param {boolean} dimmed | 353 * @param {number=} width |
| 354 */ | 354 */ |
| 355 setDimmed: function(dimmed) | 355 turnIntoSelect: function(width) |
| 356 { | |
| 357 this.element.classList.toggle("toolbar-dimmed", dimmed); | |
| 358 }, | |
| 359 | |
| 360 addDropDownArrow: function() | |
| 361 { | 356 { |
| 362 this.element.classList.add("toolbar-has-dropdown"); | 357 this.element.classList.add("toolbar-has-dropdown"); |
| 363 this.element.createChild("div", "toolbar-dropdown-arrow"); | 358 this.element.createChild("div", "toolbar-dropdown-arrow"); |
| 359 if (width) |
| 360 this.element.style.width = width + "px"; |
| 364 }, | 361 }, |
| 365 | 362 |
| 366 /** | 363 /** |
| 367 * @param {!Event} event | 364 * @param {!Event} event |
| 368 */ | 365 */ |
| 369 _clicked: function(event) | 366 _clicked: function(event) |
| 370 { | 367 { |
| 371 var defaultPrevented = this.dispatchEventToListeners("click", event); | 368 var defaultPrevented = this.dispatchEventToListeners("click", event); |
| 372 event.consume(defaultPrevented); | 369 event.consume(defaultPrevented); |
| 373 }, | 370 }, |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 /** | 945 /** |
| 949 * @return {!Promise} | 946 * @return {!Promise} |
| 950 */ | 947 */ |
| 951 onLoad: function() | 948 onLoad: function() |
| 952 { | 949 { |
| 953 return this._promise; | 950 return this._promise; |
| 954 }, | 951 }, |
| 955 | 952 |
| 956 __proto__: WebInspector.Toolbar.prototype | 953 __proto__: WebInspector.Toolbar.prototype |
| 957 } | 954 } |
| OLD | NEW |