Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: Source/devtools/front_end/ui/RootView.js

Issue 660463002: DevTools: follow up to r183724, mark all floating components as roots. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/ui/Popover.js ('k') | Source/devtools/front_end/ui/View.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 */ 8 */
9 WebInspector.RootView = function() 9 WebInspector.RootView = function()
10 { 10 {
11 WebInspector.VBox.call(this); 11 WebInspector.VBox.call(this);
12 this.markAsRoot(); 12 this.markAsRoot();
13 this.element.classList.add("root-view", "component-root"); 13 this.element.classList.add("root-view");
14 this.element.setAttribute("spellcheck", false); 14 this.element.setAttribute("spellcheck", false);
15 window.addEventListener("resize", this.doResize.bind(this), false); 15 window.addEventListener("resize", this.doResize.bind(this), false);
16 } 16 }
17 17
18 WebInspector.RootView.prototype = { 18 WebInspector.RootView.prototype = {
19 attachToBody: function() 19 attachToBody: function()
20 { 20 {
21 this.doResize(); 21 this.doResize();
22 this.show(document.body); 22 this.show(document.body);
23 }, 23 },
24 24
25 doResize: function() 25 doResize: function()
26 { 26 {
27 var size = this.constraints().minimum; 27 var size = this.constraints().minimum;
28 var zoom = WebInspector.zoomManager.zoomFactor(); 28 var zoom = WebInspector.zoomManager.zoomFactor();
29 var right = Math.min(0, window.innerWidth - size.width / zoom); 29 var right = Math.min(0, window.innerWidth - size.width / zoom);
30 this.element.style.marginRight = right + "px"; 30 this.element.style.marginRight = right + "px";
31 var bottom = Math.min(0, window.innerHeight - size.height / zoom); 31 var bottom = Math.min(0, window.innerHeight - size.height / zoom);
32 this.element.style.marginBottom = bottom + "px"; 32 this.element.style.marginBottom = bottom + "px";
33 WebInspector.VBox.prototype.doResize.call(this); 33 WebInspector.VBox.prototype.doResize.call(this);
34 }, 34 },
35 35
36 __proto__: WebInspector.VBox.prototype 36 __proto__: WebInspector.VBox.prototype
37 } 37 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/Popover.js ('k') | Source/devtools/front_end/ui/View.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698