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

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

Issue 675753002: [DevTools] Drop "ui" module from toolbox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased 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/UIUtils.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 * @suppressGlobalPropertiesCheck
9 */ 8 */
10 WebInspector.RootView = function() 9 WebInspector.RootView = function()
11 { 10 {
12 WebInspector.VBox.call(this); 11 WebInspector.VBox.call(this);
13 this.markAsRoot(); 12 this.markAsRoot();
14 this.element.classList.add("root-view"); 13 this.element.classList.add("root-view");
15 this.element.setAttribute("spellcheck", false); 14 this.element.setAttribute("spellcheck", false);
16 // This view is not designed to change owner document.
17 window.addEventListener("resize", this.doResize.bind(this), false);
18 } 15 }
19 16
20 WebInspector.RootView.prototype = { 17 WebInspector.RootView.prototype = {
21 /** 18 /**
22 * @public // FIXME: this is a workaround for validator bug (http://crbug.co m/425506). 19 * @param {!Document} document
23 * @suppressGlobalPropertiesCheck
24 */ 20 */
25 attachToBody: function() 21 attachToDocument: function(document)
26 { 22 {
23 document.defaultView.addEventListener("resize", this.doResize.bind(this) , false);
24 this._window = document.defaultView;
27 this.doResize(); 25 this.doResize();
28 this.show(document.body); 26 this.show(document.body);
29 }, 27 },
30 28
31 doResize: function() 29 doResize: function()
32 { 30 {
33 var size = this.constraints().minimum; 31 if (this._window) {
34 var zoom = WebInspector.zoomManager.zoomFactor(); 32 var size = this.constraints().minimum;
35 var right = Math.min(0, window.innerWidth - size.width / zoom); 33 var zoom = WebInspector.zoomManager.zoomFactor();
36 this.element.style.marginRight = right + "px"; 34 var right = Math.min(0, this._window.innerWidth - size.width / zoom) ;
37 var bottom = Math.min(0, window.innerHeight - size.height / zoom); 35 this.element.style.marginRight = right + "px";
38 this.element.style.marginBottom = bottom + "px"; 36 var bottom = Math.min(0, this._window.innerHeight - size.height / zo om);
37 this.element.style.marginBottom = bottom + "px";
38 }
39 WebInspector.VBox.prototype.doResize.call(this); 39 WebInspector.VBox.prototype.doResize.call(this);
40 }, 40 },
41 41
42 __proto__: WebInspector.VBox.prototype 42 __proto__: WebInspector.VBox.prototype
43 } 43 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/Popover.js ('k') | Source/devtools/front_end/ui/UIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698