mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 814592 - [toolbox] Tilt toggle command is broken, r=jwalker
This commit is contained in:
parent
e75efbd155
commit
67207c8831
@ -30,7 +30,9 @@ gcli.addCommand({
|
||||
exec: function(args, context) {
|
||||
let chromeWindow = context.environment.chromeDocument.defaultView;
|
||||
let Tilt = TiltManager.getTiltForBrowser(chromeWindow);
|
||||
Tilt.initializeForCurrentTab();
|
||||
if (!Tilt.currentInstance) {
|
||||
Tilt.toggle();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -45,15 +47,8 @@ gcli.addCommand({
|
||||
hidden: true,
|
||||
exec: function(args, context) {
|
||||
let chromeWindow = context.environment.chromeDocument.defaultView;
|
||||
|
||||
if (TiltManager._instances.has(chromeWindow)) {
|
||||
let Tilt = TiltManager.getTiltForBrowser(chromeWindow);
|
||||
Tilt.destroy(Tilt.currentWindowId);
|
||||
}
|
||||
else {
|
||||
let Tilt = TiltManager.getTiltForBrowser(chromeWindow);
|
||||
Tilt.initializeForCurrentTab();
|
||||
}
|
||||
Tilt.toggle();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -93,9 +93,9 @@ this.Tilt = function Tilt(aWindow)
|
||||
Tilt.prototype = {
|
||||
|
||||
/**
|
||||
* Initializes a visualizer for the current tab.
|
||||
* Initializes a visualizer for the current tab or closes it if already open.
|
||||
*/
|
||||
initializeForCurrentTab: function T_initializeForCurrentTab()
|
||||
toggle: function T_toggle()
|
||||
{
|
||||
let contentWindow = this.chromeWindow.gBrowser.selectedBrowser.contentWindow;
|
||||
let id = this.currentWindowId;
|
||||
|
@ -151,7 +151,7 @@ function createTilt(callbacks, close, suddenDeath) {
|
||||
|
||||
info("Attempting to start Tilt.");
|
||||
Services.obs.addObserver(onTiltOpen, INITIALIZING, false);
|
||||
Tilt.initializeForCurrentTab();
|
||||
Tilt.toggle();
|
||||
|
||||
function onTiltOpen() {
|
||||
info("Tilt was opened.");
|
||||
|
Loading…
Reference in New Issue
Block a user