Skip to content

Commit

Permalink
[FB] BMS | Fix Bugs (Floorp-Projects#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaonasi-biwa authored Mar 7, 2023
1 parent 0b1707f commit 17284bb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
31 changes: 16 additions & 15 deletions floorp/browser/base/content/browser-manager-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,11 @@
},
selectSidebarItem:()=>{
let custom_url_id = event.target.id.replace("select-", "")

if (Services.prefs.getStringPref("floorp.browser.sidebar2.page", undefined) != custom_url_id || document.getElementById("sidebar-splitter2").getAttribute("hidden") == "true") {
Services.prefs.setStringPref("floorp.browser.sidebar2.page", custom_url_id);
if (document.getElementById("sidebar-splitter2").getAttribute("hidden") == "true") {
bmsController.controllFunctions.changeVisibleWenpanel();
}
bmsController.controllFunctions.changeCheckPanel(true);
} else {

if(Services.prefs.getStringPref("floorp.browser.sidebar2.page", undefined) == custom_url_id){
bmsController.controllFunctions.changeVisibleWenpanel();
}else{
Services.prefs.setStringPref("floorp.browser.sidebar2.page", custom_url_id)
}
},
sidebarItemMouse:{
Expand Down Expand Up @@ -101,10 +97,12 @@
},
unloadWebpanel:()=>{
let sidebarsplit2 = document.getElementById("sidebar-splitter2");
Services.prefs.setStringPref("floorp.browser.sidebar2.page", "");
if(clickedWebpanel.replace("select-", "") == Services.prefs.getStringPref("floorp.browser.sidebar2.page", "")){
Services.prefs.setStringPref("floorp.browser.sidebar2.page", "");

if (sidebarsplit2.getAttribute("hidden") != "true") {
bmsController.controllFunctions.changeVisibleWenpanel();
if (sidebarsplit2.getAttribute("hidden") != "true") {
bmsController.controllFunctions.changeVisibleWenpanel();
}
}
contextWebpanel.remove();
},
Expand Down Expand Up @@ -148,6 +146,10 @@
for (let elem of document.getElementsByClassName("webpanels")) {
elem.hidden = true;
}
if(document.getElementById("sidebar-splitter2").getAttribute("hidden") == "true"){
bmsController.controllFunctions.changeVisibleWenpanel();
}
bmsController.controllFunctions.changeCheckPanel(document.getElementById("sidebar-splitter2").getAttribute("hidden") != "true");
if (selectedwebpanel != null) selectedwebpanel.hidden = false;
},
setUserContextColorLine:(id)=>{
Expand Down Expand Up @@ -176,16 +178,15 @@
let siderbar2header = document.getElementById("sidebar2-header");
let sidebarsplit2 = document.getElementById("sidebar-splitter2");
let sidebar2box = document.getElementById("sidebar2-box");
let sidebarSetting = {true:["auto","","","false",false,true,true],false:["0","0","none","true",true,false,false]}
let sidebarSetting = {true:["auto","","","false"],false:["0","0","none","true"]}
let doDisplay = sidebarsplit2.getAttribute("hidden") == "true"

sidebar2box.style.minWidth = sidebarSetting[doDisplay][0];
sidebar2box.style.maxWidth = sidebarSetting[doDisplay][1];
siderbar2header.style.display = sidebarSetting[doDisplay][2];
sidebarsplit2.setAttribute("hidden", sidebarSetting[doDisplay][3]);
bmsController.controllFunctions.changeVisibleCommandButton(sidebarSetting[doDisplay][4]);
bmsController.controllFunctions.changeCheckPanel(sidebarSetting[doDisplay][5]);
Services.prefs.setBoolPref("floorp.browser.sidebar.is.displayed", sidebarSetting[doDisplay][6]);
bmsController.controllFunctions.changeCheckPanel(doDisplay);
Services.prefs.setBoolPref("floorp.browser.sidebar.is.displayed", doDisplay);
},
setSidebarWidth:(webpanel_id)=>{
if (webpanel_id != "" && BROWSER_SIDEBAR_DATA.index.includes(webpanel_id)) {
Expand Down
1 change: 1 addition & 0 deletions floorp/browser/components/preferences/bsb.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var gBSBPane = {
if(elemUrl.startsWith("floorp//")){
elem.setAttribute("data-l10n-id", "sidebar2-" + BrowserManagerSidebar.STATIC_SIDEBAR_DATA[elemUrl].l10n);
}else{
elem.removeAttribute("data-l10n-id");
elem.textContent = elemUrl
}

Expand Down

0 comments on commit 17284bb

Please sign in to comment.