| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 }, | 391 }, |
| 392 | 392 |
| 393 _showOptions: function() | 393 _showOptions: function() |
| 394 { | 394 { |
| 395 var buttons = this._longClickOptionsData.buttonsProvider(); | 395 var buttons = this._longClickOptionsData.buttonsProvider(); |
| 396 var mainButtonClone = new WebInspector.StatusBarButton(this.title, this.
className, this.states); | 396 var mainButtonClone = new WebInspector.StatusBarButton(this.title, this.
className, this.states); |
| 397 mainButtonClone.addEventListener("click", this._clicked, this); | 397 mainButtonClone.addEventListener("click", this._clicked, this); |
| 398 mainButtonClone.state = this.state; | 398 mainButtonClone.state = this.state; |
| 399 buttons.push(mainButtonClone); | 399 buttons.push(mainButtonClone); |
| 400 | 400 |
| 401 var document = this.element.ownerDocument; |
| 401 document.documentElement.addEventListener("mouseup", mouseUp, false); | 402 document.documentElement.addEventListener("mouseup", mouseUp, false); |
| 402 | 403 |
| 403 var optionsGlassPane = new WebInspector.GlassPane(); | 404 var optionsGlassPane = new WebInspector.GlassPane(document); |
| 404 var optionsBarElement = optionsGlassPane.element.createChild("div", "alt
ernate-status-bar-buttons-bar"); | 405 var optionsBarElement = optionsGlassPane.element.createChild("div", "alt
ernate-status-bar-buttons-bar"); |
| 405 const buttonHeight = 23; | 406 const buttonHeight = 23; |
| 406 | 407 |
| 407 var hostButtonPosition = this.element.totalOffset(); | 408 var hostButtonPosition = this.element.totalOffset(); |
| 408 | 409 |
| 409 var topNotBottom = hostButtonPosition.top + buttonHeight * buttons.lengt
h < document.documentElement.offsetHeight; | 410 var topNotBottom = hostButtonPosition.top + buttonHeight * buttons.lengt
h < document.documentElement.offsetHeight; |
| 410 | 411 |
| 411 if (topNotBottom) | 412 if (topNotBottom) |
| 412 buttons = buttons.reverse(); | 413 buttons = buttons.reverse(); |
| 413 | 414 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 var options = []; | 747 var options = []; |
| 747 for (var index = 0; index < this._states.length; index++) { | 748 for (var index = 0; index < this._states.length; index++) { |
| 748 if (this._states[index] !== this.state && this._states[index] !== th
is._currentState) | 749 if (this._states[index] !== this.state && this._states[index] !== th
is._currentState) |
| 749 options.push(this._buttons[index]); | 750 options.push(this._buttons[index]); |
| 750 } | 751 } |
| 751 return options; | 752 return options; |
| 752 }, | 753 }, |
| 753 | 754 |
| 754 __proto__: WebInspector.StatusBarButton.prototype | 755 __proto__: WebInspector.StatusBarButton.prototype |
| 755 } | 756 } |
| OLD | NEW |