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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 * @param {!Element=} parentElement | 33 * @param {!Element=} parentElement |
34 */ | 34 */ |
35 WebInspector.Toolbar = function(parentElement) | 35 WebInspector.Toolbar = function(parentElement) |
36 { | 36 { |
37 /** @type {!Array.<!WebInspector.ToolbarItem>} */ | 37 /** @type {!Array.<!WebInspector.ToolbarItem>} */ |
38 this._items = []; | 38 this._items = []; |
39 this.element = parentElement ? parentElement.createChild("div", "toolbar") :
createElementWithClass("div", "toolbar"); | 39 this.element = parentElement ? parentElement.createChild("div", "toolbar") :
createElementWithClass("div", "toolbar"); |
40 | |
41 this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element)
; | 40 this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element)
; |
42 this._shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/tool
bar.css")); | 41 this._shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/tool
bar.css")); |
43 this._contentElement = this._shadowRoot.createChild("div", "toolbar-shadow")
; | 42 this._contentElement = this._shadowRoot.createChild("div", "toolbar-shadow")
; |
44 this._contentElement.createChild("content"); | 43 this._contentElement.createChild("content"); |
45 } | 44 } |
46 | 45 |
47 WebInspector.Toolbar.prototype = { | 46 WebInspector.Toolbar.prototype = { |
48 makeNarrow: function() | 47 makeNarrow: function() |
49 { | 48 { |
50 this._contentElement.classList.add("narrow"); | 49 this._contentElement.classList.add("narrow"); |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 function mouseUp(e) | 530 function mouseUp(e) |
532 { | 531 { |
533 if (e.which !== 1) | 532 if (e.which !== 1) |
534 return; | 533 return; |
535 optionsGlassPane.dispose(); | 534 optionsGlassPane.dispose(); |
536 document.documentElement.removeEventListener("mouseup", mouseUp, fal
se); | 535 document.documentElement.removeEventListener("mouseup", mouseUp, fal
se); |
537 | 536 |
538 for (var i = 0; i < buttons.length; ++i) { | 537 for (var i = 0; i < buttons.length; ++i) { |
539 if (buttons[i].element.classList.contains("emulate-active")) { | 538 if (buttons[i].element.classList.contains("emulate-active")) { |
540 buttons[i].element.classList.remove("emulate-active"); | 539 buttons[i].element.classList.remove("emulate-active"); |
541 buttons[i]._clicked(); | 540 buttons[i]._clicked(e); |
542 break; | 541 break; |
543 } | 542 } |
544 } | 543 } |
545 } | 544 } |
546 }, | 545 }, |
547 | 546 |
548 __proto__: WebInspector.ToolbarItem.prototype | 547 __proto__: WebInspector.ToolbarItem.prototype |
549 } | 548 } |
550 | 549 |
551 /** | 550 /** |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 for (var i = 0; i < items.length; ++i) { | 990 for (var i = 0; i < items.length; ++i) { |
992 var item = items[i]; | 991 var item = items[i]; |
993 if (item) | 992 if (item) |
994 this.appendToolbarItem(item); | 993 this.appendToolbarItem(item); |
995 } | 994 } |
996 } | 995 } |
997 }, | 996 }, |
998 | 997 |
999 __proto__: WebInspector.Toolbar.prototype | 998 __proto__: WebInspector.Toolbar.prototype |
1000 } | 999 } |
OLD | NEW |