OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |