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 18 matching lines...) Expand all Loading... | |
29 */ | 29 */ |
30 | 30 |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 * @extends {WebInspector.VBox} | 33 * @extends {WebInspector.VBox} |
34 */ | 34 */ |
35 WebInspector.InspectorView = function() | 35 WebInspector.InspectorView = function() |
36 { | 36 { |
37 WebInspector.VBox.call(this); | 37 WebInspector.VBox.call(this); |
38 WebInspector.Dialog.setModalHostView(this); | 38 WebInspector.Dialog.setModalHostView(this); |
39 this.setMinimumSize(180, 72); | |
39 | 40 |
40 // DevTools sidebar is a vertical split of panels tabbed pane and a drawer. | 41 // DevTools sidebar is a vertical split of panels tabbed pane and a drawer. |
41 this._drawerSplitView = new WebInspector.SplitView(false, true, "Inspector.d rawerSplitViewState", 200, 200); | 42 this._drawerSplitView = new WebInspector.SplitView(false, true, "Inspector.d rawerSplitViewState", 200, 200); |
42 this._drawerSplitView.hideSidebar(); | 43 this._drawerSplitView.hideSidebar(); |
43 this._drawerSplitView.enableShowModeSaving(); | 44 this._drawerSplitView.enableShowModeSaving(); |
44 this._drawerSplitView.setSidebarElementConstraints(Preferences.minDrawerHeig ht, Preferences.minDrawerHeight); | |
45 this._drawerSplitView.setMainElementConstraints(25, 25); | |
46 this._drawerSplitView.show(this.element); | 45 this._drawerSplitView.show(this.element); |
47 | 46 |
48 this._tabbedPane = new WebInspector.TabbedPane(); | 47 this._tabbedPane = new WebInspector.TabbedPane(); |
49 this._tabbedPane.setRetainTabOrder(true, WebInspector.moduleManager.orderCom parator(WebInspector.Panel, "name", "order")); | 48 this._tabbedPane.setRetainTabOrder(true, WebInspector.moduleManager.orderCom parator(WebInspector.Panel, "name", "order")); |
50 this._tabbedPane.show(this._drawerSplitView.mainElement()); | 49 this._tabbedPane.show(this._drawerSplitView.mainElement()); |
51 this._drawer = new WebInspector.Drawer(this._drawerSplitView); | 50 this._drawer = new WebInspector.Drawer(this._drawerSplitView); |
52 | 51 |
53 // Patch tabbed pane header with toolbar actions. | 52 // Patch tabbed pane header with toolbar actions. |
54 this._toolbarElement = document.createElement("div"); | 53 this._toolbarElement = document.createElement("div"); |
55 this._toolbarElement.className = "toolbar toolbar-background"; | 54 this._toolbarElement.className = "toolbar toolbar-background"; |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
433 WebInspector.inspectorView; | 432 WebInspector.inspectorView; |
434 | 433 |
435 /** | 434 /** |
436 * @constructor | 435 * @constructor |
437 * @extends {WebInspector.VBox} | 436 * @extends {WebInspector.VBox} |
438 */ | 437 */ |
439 WebInspector.RootView = function() | 438 WebInspector.RootView = function() |
440 { | 439 { |
441 WebInspector.VBox.call(this); | 440 WebInspector.VBox.call(this); |
442 this.markAsRoot(); | 441 this.markAsRoot(); |
443 this.element.classList.add("fill", "root-view"); | 442 this.element.classList.add("root-view"); |
444 this.element.setAttribute("spellcheck", false); | 443 this.element.setAttribute("spellcheck", false); |
445 window.addEventListener("resize", this.doResize.bind(this), true); | 444 window.addEventListener("resize", this.doResize.bind(this), true); |
445 window.addEventListener("scroll", this._onScroll.bind(this), false); | |
446 }; | 446 }; |
447 | 447 |
448 WebInspector.RootView.prototype = { | 448 WebInspector.RootView.prototype = { |
449 attachToBody: function() | |
450 { | |
451 var body = document.body; | |
452 body.style.height = "100%"; | |
453 body.style.width = "100%"; | |
vsevik
2014/03/25 12:30:51
Let's move this to css.
dgozman
2014/03/25 14:13:58
Done.
| |
454 body.style.overflow = "hidden"; | |
455 this.doResize(); | |
456 this.show(body); | |
457 }, | |
458 | |
459 _onScroll: function() | |
460 { | |
461 // If we didn't have enough space at the start, we may have wrong scroll offsets. | |
462 if (document.body.scrollTop !== 0) | |
463 document.body.scrollTop = 0; | |
464 if (document.body.scrollLeft !== 0) | |
465 document.body.scrollLeft = 0; | |
466 }, | |
467 | |
468 doResize: function() | |
469 { | |
470 var size = this.minimumSize(); | |
471 var right = Math.min(0, window.innerWidth - size.width); | |
472 this.element.style.right = right + "px"; | |
473 var bottom = Math.min(0, window.innerHeight - size.height); | |
474 this.element.style.bottom = bottom + "px"; | |
vsevik
2014/03/25 13:26:04
Let's set scroll listener when the size is not eno
dgozman
2014/03/25 14:13:58
Done.
| |
475 | |
476 WebInspector.VBox.prototype.doResize.call(this); | |
477 document.body.scrollTop = 0; | |
478 document.body.scrollLeft = 0; | |
479 }, | |
480 | |
449 __proto__: WebInspector.VBox.prototype | 481 __proto__: WebInspector.VBox.prototype |
450 }; | 482 }; |
OLD | NEW |