diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-15 22:23:57 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-15 22:23:57 +0200 |
commit | 0f8df53ae7d831410407c182d489927cce5c3597 (patch) | |
tree | ab8b35fda02f1ffa8be8937e3e78a31056bef131 /toolkit/content/widgets | |
parent | 4cfe5d84de0b8976f8bc5c005ae12ac3adf8f18a (diff) | |
download | UXP-0f8df53ae7d831410407c182d489927cce5c3597.tar UXP-0f8df53ae7d831410407c182d489927cce5c3597.tar.gz UXP-0f8df53ae7d831410407c182d489927cce5c3597.tar.lz UXP-0f8df53ae7d831410407c182d489927cce5c3597.tar.xz UXP-0f8df53ae7d831410407c182d489927cce5c3597.zip |
palemoon#903: Customizable toolbars - persist the attribute "collapsed"
https://github.com/MoonchildProductions/Pale-Moon/pull/903
Diffstat (limited to 'toolkit/content/widgets')
-rw-r--r-- | toolkit/content/widgets/toolbar.xml | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/toolkit/content/widgets/toolbar.xml b/toolkit/content/widgets/toolbar.xml index 548504e24..e79843dbd 100644 --- a/toolkit/content/widgets/toolbar.xml +++ b/toolkit/content/widgets/toolbar.xml @@ -49,6 +49,7 @@ <constructor> <![CDATA[ + this.toolbarInfoSeparators = ["|", "-"]; // Look to see if there is a toolbarset. this.toolbarset = this.firstChild; while (this.toolbarset && this.toolbarset.localName != "toolbarset") @@ -57,10 +58,14 @@ if (this.toolbarset) { // Create each toolbar described by the toolbarset. var index = 0; - while (toolbarset.hasAttribute("toolbar"+(++index))) { - var toolbarInfo = toolbarset.getAttribute("toolbar"+index); - var infoSplit = toolbarInfo.split(":"); - this.appendCustomToolbar(infoSplit[0], infoSplit[1]); + while (this.toolbarset.hasAttribute("toolbar" + (++index))) { + var toolbarInfo = this.toolbarset.getAttribute("toolbar"+index); + var infoSplit = toolbarInfo.split(this.toolbarInfoSeparators[0]); + var infoName = infoSplit[0]; + var infoHidingAttribute = infoSplit[1].split(this.toolbarInfoSeparators[1]); + var infoCurrentSet = infoSplit[2]; + + this.appendCustomToolbar(infoName, infoCurrentSet, infoHidingAttribute); } } ]]> @@ -69,6 +74,7 @@ <method name="appendCustomToolbar"> <parameter name="aName"/> <parameter name="aCurrentSet"/> + <parameter name="aHidingAttribute"/> <body> <![CDATA[ if (!this.toolbarset) @@ -84,6 +90,10 @@ toolbar.setAttribute("iconsize", this.getAttribute("iconsize")); toolbar.setAttribute("context", this.toolbarset.getAttribute("context")); toolbar.setAttribute("class", "chromeclass-toolbar"); + // Restore persist the hiding attribute. + if (aHidingAttribute[0]) { + toolbar.setAttribute(aHidingAttribute[0], aHidingAttribute[1]); + } this.insertBefore(toolbar, this.toolbarset); return toolbar; |