Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Remove HTitleWindowControls from overlay for SeaMonkey (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
seleznev committed Jul 27, 2014
1 parent c4c7775 commit 7f47307
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
28 changes: 18 additions & 10 deletions extension/chrome/content/HTitle.js
Expand Up @@ -26,15 +26,17 @@ var HTitle = {
return;
}

HTitle.window = document.getElementById(HTitleUtils.isThunderbird() ? "messengerWindow" : "main-window");
HTitle.window = window.document.documentElement;

HTitle.start();

if (HTitleUtils.prefs.getBoolPref("window_controls.get_layout_by_gsettings"))
HTitleWindowControls.setLayoutAttribute();
if (typeof HTitleWindowControls != "undefined") {
if (HTitleUtils.prefs.getBoolPref("window_controls.get_layout_by_gsettings"))
HTitleWindowControls.setLayoutAttribute();

if (HTitleUtils.prefs.getBoolPref("show_window_controls"))
HTitleWindowControls.show();
if (HTitleUtils.prefs.getBoolPref("show_window_controls"))
HTitleWindowControls.show();
}
},

start: function() {
Expand Down Expand Up @@ -93,6 +95,9 @@ var HTitle = {

switch(data) {
case "show_window_controls":
if (typeof HTitleWindowControls == "undefined") {
break;
}
if (HTitleUtils.prefs.getBoolPref("show_window_controls")) {
HTitleUtils.log("Enable show close button", "DEBUG");
HTitleWindowControls.updatePosition(null);
Expand All @@ -105,28 +110,30 @@ var HTitle = {
break;
case "legacy_mode.enable":
if (HTitle.ENABLED && !HTitleShare.defaultMethodFailed && !HTitle.isStopped) {
if (HTitleUtils.prefs.getBoolPref("show_window_controls"))
let wc = (typeof HTitleWindowControls != "undefined");
if (wc && HTitleUtils.prefs.getBoolPref("show_window_controls"))
HTitleWindowControls.hide();

HTitle.stop();
HTitleUtils.prefs.setIntPref("hide_mode", 1);
HTitle.start();

if (HTitleUtils.prefs.getBoolPref("show_window_controls"))
if (wc && HTitleUtils.prefs.getBoolPref("show_window_controls"))
HTitleWindowControls.show();
}
break;
case "hide_mode":
if (HTitle.ENABLED && !HTitle.isStopped) {
if (HTitleUtils.prefs.getBoolPref("show_window_controls"))
let wc = (typeof HTitleWindowControls != "undefined");
if (wc && HTitleUtils.prefs.getBoolPref("show_window_controls"))
HTitleWindowControls.hide();

HTitle.stop();
if (HTitleUtils.prefs.getIntPref("hide_mode") != 1)
HTitleUtils.prefs.setBoolPref("legacy_mode.enable", false);
HTitle.start();

if (HTitleUtils.prefs.getBoolPref("show_window_controls"))
if (wc && HTitleUtils.prefs.getBoolPref("show_window_controls"))
HTitleWindowControls.show();
}
break;
Expand Down Expand Up @@ -219,7 +226,8 @@ var HTitle = {

shutdown: function() {
HTitleUtils.prefs.removeObserver("", HTitle);
//if (HTitleUtils.prefs.getBoolPref("show_window_controls"))
//let wc = (typeof HTitleWindowControls != "undefined");
//if (wc && HTitleUtils.prefs.getBoolPref("show_window_controls"))
// HTitleWindowControls.hide();
},
}
Expand Down
8 changes: 0 additions & 8 deletions extension/chrome/content/HTitleWindowControls.js
Expand Up @@ -15,10 +15,6 @@ var HTitleWindowControls = {
},

show: function() {
if (HTitleUtils.isSeaMonkey()) {
return; // FIXME
}

var windowctls = document.getElementById("window-controls");
windowctls.setAttribute("htitle", "true");
HTitleUtils.loadStyle("windowControls"); // Appling CSS
Expand Down Expand Up @@ -53,10 +49,6 @@ var HTitleWindowControls = {
},

hide: function() {
if (HTitleUtils.isSeaMonkey()) {
return; // FIXME
}

HTitleUtils.unloadStyle("windowControls");

var spring = document.getElementById("htitle-menubar-spring");
Expand Down
1 change: 0 additions & 1 deletion extension/chrome/content/overlaySeaMonkey.xul
Expand Up @@ -12,7 +12,6 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">

<script type="application/x-javascript" src="chrome://htitle/content/HTitleWindowControls.js"/>
<script type="application/x-javascript" src="chrome://htitle/content/HTitle.js"/>

<window id="main-window">
Expand Down

0 comments on commit 7f47307

Please sign in to comment.