OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library debugger_page_element; | 5 library debugger_page_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'dart:math'; | 9 import 'dart:math'; |
10 import 'observatory_element.dart'; | 10 import 'observatory_element.dart'; |
11 import 'nav_bar.dart'; | |
12 import 'package:observatory/app.dart'; | 11 import 'package:observatory/app.dart'; |
13 import 'package:observatory/cli.dart'; | 12 import 'package:observatory/cli.dart'; |
14 import 'package:observatory/debugger.dart'; | 13 import 'package:observatory/debugger.dart'; |
15 import 'package:observatory/service.dart'; | 14 import 'package:observatory/service.dart'; |
16 import 'package:logging/logging.dart'; | 15 import 'package:logging/logging.dart'; |
17 import 'package:polymer/polymer.dart'; | 16 import 'package:polymer/polymer.dart'; |
18 | 17 |
19 // TODO(turnidge): Move Debugger, DebuggerCommand to debugger library. | 18 // TODO(turnidge): Move Debugger, DebuggerCommand to debugger library. |
20 abstract class DebuggerCommand extends Command { | 19 abstract class DebuggerCommand extends Command { |
21 ObservatoryDebugger debugger; | 20 ObservatoryDebugger debugger; |
(...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1998 debugger.flushStdio(); | 1997 debugger.flushStdio(); |
1999 } | 1998 } |
2000 | 1999 |
2001 void _onResize(_) { | 2000 void _onResize(_) { |
2002 var navbarDiv = $['navbarDiv']; | 2001 var navbarDiv = $['navbarDiv']; |
2003 var stackDiv = $['stackDiv']; | 2002 var stackDiv = $['stackDiv']; |
2004 var splitterDiv = $['splitterDiv']; | 2003 var splitterDiv = $['splitterDiv']; |
2005 var cmdDiv = $['commandDiv']; | 2004 var cmdDiv = $['commandDiv']; |
2006 | 2005 |
2007 // For now, force navbar height to 40px in the debugger. | 2006 // For now, force navbar height to 40px in the debugger. |
2008 int navbarHeight = NavBarElement.height; | 2007 // TODO (cbernaschina) check if this is needed. |
| 2008 const navbarHeight = 40; |
2009 int splitterHeight = splitterDiv.clientHeight; | 2009 int splitterHeight = splitterDiv.clientHeight; |
2010 int cmdHeight = cmdDiv.clientHeight; | 2010 int cmdHeight = cmdDiv.clientHeight; |
2011 | 2011 |
2012 int windowHeight = window.innerHeight; | 2012 int windowHeight = window.innerHeight; |
2013 int fixedHeight = navbarHeight + splitterHeight + cmdHeight; | 2013 int fixedHeight = navbarHeight + splitterHeight + cmdHeight; |
2014 int available = windowHeight - fixedHeight; | 2014 int available = windowHeight - fixedHeight; |
2015 int stackHeight = available ~/ 1.6; | 2015 int stackHeight = available ~/ 1.6; |
2016 navbarDiv.style.setProperty('height', '${navbarHeight}px'); | 2016 navbarDiv.style.setProperty('height', '${navbarHeight}px'); |
2017 stackDiv.style.setProperty('height', '${stackHeight}px'); | 2017 stackDiv.style.setProperty('height', '${stackHeight}px'); |
2018 } | 2018 } |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2248 frame = newFrame; | 2248 frame = newFrame; |
2249 } | 2249 } |
2250 | 2250 |
2251 Script get script => frame.location.script; | 2251 Script get script => frame.location.script; |
2252 | 2252 |
2253 int _varsTop(varsDiv) { | 2253 int _varsTop(varsDiv) { |
2254 const minTop = 5; | 2254 const minTop = 5; |
2255 if (varsDiv == null) { | 2255 if (varsDiv == null) { |
2256 return minTop; | 2256 return minTop; |
2257 } | 2257 } |
2258 const navbarHeight = NavBarElement.height; | 2258 // TODO (cbernaschina) check if this is needed. |
| 2259 const navbarHeight = 40; |
2259 const bottomPad = 6; | 2260 const bottomPad = 6; |
2260 var parent = varsDiv.parent.getBoundingClientRect(); | 2261 var parent = varsDiv.parent.getBoundingClientRect(); |
2261 var varsHeight = varsDiv.clientHeight; | 2262 var varsHeight = varsDiv.clientHeight; |
2262 var maxTop = parent.height - (varsHeight + bottomPad); | 2263 var maxTop = parent.height - (varsHeight + bottomPad); |
2263 var adjustedTop = navbarHeight - parent.top; | 2264 var adjustedTop = navbarHeight - parent.top; |
2264 return (max(minTop, min(maxTop, adjustedTop))); | 2265 return (max(minTop, min(maxTop, adjustedTop))); |
2265 } | 2266 } |
2266 | 2267 |
2267 void _onScroll(event) { | 2268 void _onScroll(event) { |
2268 if (!expanded) { | 2269 if (!expanded) { |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2704 } | 2705 } |
2705 }); | 2706 }); |
2706 } | 2707 } |
2707 | 2708 |
2708 void focus() { | 2709 void focus() { |
2709 $['textBox'].focus(); | 2710 $['textBox'].focus(); |
2710 } | 2711 } |
2711 | 2712 |
2712 DebuggerInputElement.created() : super.created(); | 2713 DebuggerInputElement.created() : super.created(); |
2713 } | 2714 } |
OLD | NEW |