OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 21 matching lines...) Expand all Loading... | |
32 * @constructor | 32 * @constructor |
33 * @extends {WebInspector.View} | 33 * @extends {WebInspector.View} |
34 */ | 34 */ |
35 WebInspector.InspectorView = function() | 35 WebInspector.InspectorView = function() |
36 { | 36 { |
37 WebInspector.View.call(this); | 37 WebInspector.View.call(this); |
38 this.markAsRoot(); | 38 this.markAsRoot(); |
39 this.element.classList.add("fill", "vbox"); | 39 this.element.classList.add("fill", "vbox"); |
40 this.element.setAttribute("spellcheck", false); | 40 this.element.setAttribute("spellcheck", false); |
41 | 41 |
42 this._splitView = new WebInspector.InspectorView.SplitView(); | |
43 this._splitView.addEventListener(WebInspector.InspectorView.SplitView.Events .LayoutChanged, this._onSplitViewLayout.bind(this)); | |
44 this._splitView.element.id = "inspector-split-view"; | |
45 this._splitView.show(this.element); | |
46 | |
47 this._overlay = this._splitView.mainElement; | |
pfeldman
2013/11/18 15:07:42
_overlayElement
dgozman
2013/11/21 16:38:51
Done.
| |
48 this._container = this._splitView.sidebarElement; | |
pfeldman
2013/11/18 15:07:42
_devtoolsElement
dgozman
2013/11/21 16:38:51
Done.
| |
49 this._container.classList.add("vbox"); | |
50 | |
42 this._tabbedPane = new WebInspector.TabbedPane(); | 51 this._tabbedPane = new WebInspector.TabbedPane(); |
43 this._tabbedPane.setRetainTabsOrder(true); | 52 this._tabbedPane.setRetainTabsOrder(true); |
44 this._tabbedPane.show(this.element); | 53 this._tabbedPane.show(this._container); |
45 | 54 |
46 var toolbarElement = document.createElement("div"); | 55 var toolbarElement = document.createElement("div"); |
47 toolbarElement.className = "toolbar toolbar-background"; | 56 toolbarElement.className = "toolbar toolbar-background"; |
48 var headerElement = this._tabbedPane.headerElement(); | 57 var headerElement = this._tabbedPane.headerElement(); |
49 headerElement.parentElement.insertBefore(toolbarElement, headerElement); | 58 headerElement.parentElement.insertBefore(toolbarElement, headerElement); |
50 | 59 |
51 this._leftToolbarElement = toolbarElement.createChild("div", "toolbar-contro ls-left"); | 60 this._leftToolbarElement = toolbarElement.createChild("div", "toolbar-contro ls-left"); |
52 toolbarElement.appendChild(headerElement); | 61 toolbarElement.appendChild(headerElement); |
53 this._rightToolbarElement = toolbarElement.createChild("div", "toolbar-contr ols-right"); | 62 this._rightToolbarElement = toolbarElement.createChild("div", "toolbar-contr ols-right"); |
54 | 63 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 | 98 |
90 /** | 99 /** |
91 * @return {WebInspector.Drawer} | 100 * @return {WebInspector.Drawer} |
92 */ | 101 */ |
93 drawer: function() | 102 drawer: function() |
94 { | 103 { |
95 return this._drawer; | 104 return this._drawer; |
96 }, | 105 }, |
97 | 106 |
98 /** | 107 /** |
108 * @return {WebInspector.View} | |
109 */ | |
110 container: function() | |
pfeldman
2013/11/18 15:07:42
devtoolsElement
dgozman
2013/11/21 16:38:51
Done.
| |
111 { | |
112 return this._container; | |
113 }, | |
114 | |
115 /** | |
99 * @param {WebInspector.PanelDescriptor} panelDescriptor | 116 * @param {WebInspector.PanelDescriptor} panelDescriptor |
100 */ | 117 */ |
101 addPanel: function(panelDescriptor) | 118 addPanel: function(panelDescriptor) |
102 { | 119 { |
103 var panelName = panelDescriptor.name(); | 120 var panelName = panelDescriptor.name(); |
104 this._panelDescriptors[panelName] = panelDescriptor; | 121 this._panelDescriptors[panelName] = panelDescriptor; |
105 this._tabbedPane.appendTab(panelName, panelDescriptor.title(), new WebIn spector.View()); | 122 this._tabbedPane.appendTab(panelName, panelDescriptor.title(), new WebIn spector.View()); |
106 if (this._lastActivePanelSetting.get() === panelName) | 123 if (this._lastActivePanelSetting.get() === panelName) |
107 this._tabbedPane.selectTab(panelName); | 124 this._tabbedPane.selectTab(panelName); |
108 }, | 125 }, |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 this._historyIterator = this._history.length - 1; | 359 this._historyIterator = this._history.length - 1; |
343 }, | 360 }, |
344 | 361 |
345 onResize: function() | 362 onResize: function() |
346 { | 363 { |
347 // FIXME: make drawer a view. | 364 // FIXME: make drawer a view. |
348 this.doResize(); | 365 this.doResize(); |
349 this._drawer.resize(); | 366 this._drawer.resize(); |
350 }, | 367 }, |
351 | 368 |
369 _onSplitViewLayout: function() | |
370 { | |
371 // FIXME: make drawer a view. | |
pfeldman
2013/11/18 15:07:42
Yes!
| |
372 this._drawer.resize(); | |
373 }, | |
374 | |
352 __proto__: WebInspector.View.prototype | 375 __proto__: WebInspector.View.prototype |
353 } | 376 }; |
377 | |
378 | |
379 /** | |
380 * @constructor | |
381 * @extends {WebInspector.SplitView} | |
382 */ | |
383 WebInspector.InspectorView.SplitView = function() | |
pfeldman
2013/11/18 15:07:42
Not sure you need it, InspectorView is not that hu
dgozman
2013/11/21 16:38:51
Done.
| |
384 { | |
385 WebInspector.SplitView.call(this, false, "InspectorViewContentsSize", 300, 3 00); | |
386 this.setSecondIsSidebar(true); | |
387 this.setSidebarElementConstraints(150, 50); | |
388 this.setMainElementConstraints(50, 50); | |
389 this._update(); | |
390 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._update.bind(this)); | |
391 }; | |
392 | |
393 WebInspector.InspectorView.SplitView.Events = { | |
394 LayoutChanged: "LayoutChanged" | |
395 }; | |
396 | |
397 WebInspector.InspectorView.SplitView.prototype = { | |
398 _update: function() | |
399 { | |
400 if (WebInspector.useOverlayContentsLayout()) { | |
401 this.showBoth(); | |
402 this.setVertical(WebInspector.dockController.dockSide() === WebInspe ctor.DockController.State.DockedToRight); | |
403 } else { | |
404 this.showOnlySecond(); | |
405 } | |
406 }, | |
407 | |
408 onLayoutUpdated: function(size) | |
409 { | |
410 this.dispatchEventToListeners(WebInspector.InspectorView.SplitView.Event s.LayoutChanged); | |
411 | |
412 if (!WebInspector.useOverlayContentsLayout()) | |
413 return; | |
414 // Leave 2px room for resizer. | |
415 var bottom = this.isVertical() ? 0 : this.sidebarSize() + 2; | |
416 var right = this.isVertical() ? this.sidebarSize() + 2 : 0; | |
417 InspectorFrontendHost.setContentsOffsets(0, 0, right, bottom); | |
418 }, | |
419 | |
420 __proto__: WebInspector.SplitView.prototype | |
421 }; | |
354 | 422 |
355 /** | 423 /** |
356 * @type {WebInspector.InspectorView} | 424 * @type {WebInspector.InspectorView} |
357 */ | 425 */ |
358 WebInspector.inspectorView = null; | 426 WebInspector.inspectorView = null; |
OLD | NEW |