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

Side by Side Diff: Source/devtools/front_end/StatusBarButton.js

Issue 71633003: DevTools: added "overlayContents" mode, where DevTools content is placed around and underneath inse… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: No-op if no overlayContents Created 7 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 var mouseUpListener = mouseUp.bind(this); 315 var mouseUpListener = mouseUp.bind(this);
316 document.documentElement.addEventListener("mouseup", mouseUpListener, fa lse); 316 document.documentElement.addEventListener("mouseup", mouseUpListener, fa lse);
317 317
318 var optionsGlassPane = new WebInspector.GlassPane(); 318 var optionsGlassPane = new WebInspector.GlassPane();
319 var optionsBarElement = optionsGlassPane.element.createChild("div", "alt ernate-status-bar-buttons-bar"); 319 var optionsBarElement = optionsGlassPane.element.createChild("div", "alt ernate-status-bar-buttons-bar");
320 const buttonHeight = 23; 320 const buttonHeight = 23;
321 321
322 var hostButtonPosition = this.element.totalOffset(); 322 var hostButtonPosition = this.element.totalOffset();
323 323
324 var topNotBottom = hostButtonPosition.top < document.documentElement.off setHeight / 2; 324 var topNotBottom = hostButtonPosition.top + buttonHeight * buttons.lengt h < document.documentElement.offsetHeight;
325 325
326 if (topNotBottom) 326 if (topNotBottom)
327 buttons = buttons.reverse(); 327 buttons = buttons.reverse();
328 328
329 optionsBarElement.style.height = (buttonHeight * buttons.length) + "px"; 329 optionsBarElement.style.height = (buttonHeight * buttons.length) + "px";
330 if (topNotBottom) 330 if (topNotBottom)
331 optionsBarElement.style.top = (hostButtonPosition.top + 1) + "px"; 331 optionsBarElement.style.top = (hostButtonPosition.top + 1) + "px";
332 else 332 else
333 optionsBarElement.style.top = (hostButtonPosition.top - (buttonHeigh t * (buttons.length - 1))) + "px"; 333 optionsBarElement.style.top = (hostButtonPosition.top - (buttonHeigh t * (buttons.length - 1))) + "px";
334 optionsBarElement.style.left = (hostButtonPosition.left + 1) + "px"; 334 optionsBarElement.style.left = (hostButtonPosition.left + 1) + "px";
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 /** 490 /**
491 * @return {number} 491 * @return {number}
492 */ 492 */
493 selectedIndex: function() 493 selectedIndex: function()
494 { 494 {
495 return this._selectElement.selectedIndex; 495 return this._selectElement.selectedIndex;
496 }, 496 },
497 497
498 __proto__: WebInspector.StatusBarItem.prototype 498 __proto__: WebInspector.StatusBarItem.prototype
499 } 499 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698