Skip to content

Commit

Permalink
Cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
p1usminus committed May 27, 2023
1 parent a7cbab9 commit baed845
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
24 changes: 1 addition & 23 deletions src/content/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,8 @@
let pl = parseInt(getComputedStyle(options).getPropertyValue("-moz-padding-start"), 10);
let pr = parseInt(getComputedStyle(options).getPropertyValue("-moz-padding-end"), 10);
window.requestAnimationFrame(() => {
window.resizeTo(document.getElementById("roomybookmarkstoolbarTabBox").scrollWidth+pl+pr, window.outerHeight); // this works!
});
options.addEventListener("dialogextra1", function(event) {
//window.resizeBy(20,0);
//window.resizeTo(options.clientWidth+50, window.outerHeight); //document.getElementById("roomybookmarkstoolbarPreferences").clientHeight
window.resizeTo(document.getElementById("roomybookmarkstoolbarTabBox").scrollWidth+pl+pr, window.outerHeight);
//window.resizeTo(options.clientWidth+pl+pr, window.outerHeight); // works but dialog box grows with every button click ???
//window.resizeTo(options.scrollWidth, window.outerHeight); //scrollWidth almost works
console.log("Window width: "+window.outerWidth);
//console.log(getComputedStyle(options));
//console.log("Tabpanel width: "+options.width);
console.log("Dialog width: "+options.clientWidth);
});
});
},

onLoad: function() {
Expand All @@ -130,16 +119,5 @@
this.location();
this.resizeOptions();
Preferences.forceEnableInstantApply();
//console.log(window); // too much information
//console.log(window.outerWidth); // = 1
//console.log(window.clientWidth); // = undefined
//console.log(document.getElementById("roomybookmarkstoolbarPreferences")); // initially clientWidth = scrollWidth = 0, but when opened again, clientWidth = 518, scrollWidth = 526
// console.log(document.getElementById("roomybookmarkstoolbarTabBox")); // clientWidth = 500, scrollWidth = 518
// I think 18 pixel difference between dialog and TabBox = 10px padding-left, 8px padding-right or paddingInlineStart/End
//console.log(document.getElementById("roomybookmarkstoolbar.options.tab1")); // clientWidth = scrollWidth = 150, the width of the actual tab at the top, cannot use this
//window.sizeToContent();
/* window.requestAnimationFrame(() => {
window.sizeToContent();
}); */
},
};
5 changes: 1 addition & 4 deletions src/content/options.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
<!DOCTYPE dialog SYSTEM "chrome://roomybookmarkstoolbar/locale/options.dtd">

<dialog id="roomybookmarkstoolbarPreferences"
buttons="accept,extra1"
buttons="accept"
title="&roomybookmarkstoolbar.options.window.title;"
onload="roomybookmarkstoolbarOptions.onLoad();"
buttonlabelextra1="Resize"
resizable="yes"
flex="1"
style="padding-left:50px; padding-right:50px"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

Expand Down

0 comments on commit baed845

Please sign in to comment.