diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2017-02-18 09:22:33 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2017-02-18 09:22:33 +0100 |
commit | 0e780658e43c936df43934f0eb57b16f8c855301 (patch) | |
tree | 3b07127e7a17500f3a385ac78c3246eea87005f5 /toolkit/content | |
parent | 75351dafe86ad14f8e5489d570122336232e7f68 (diff) | |
download | palemoon-gre-0e780658e43c936df43934f0eb57b16f8c855301.tar.gz |
[suggestion] Customizable toolbars - persist the attribute "collapsed"
Diffstat (limited to 'toolkit/content')
-rw-r--r-- | toolkit/content/customizeToolbar.js | 2 | ||||
-rw-r--r-- | toolkit/content/widgets/toolbar.xml | 20 |
2 files changed, 19 insertions, 3 deletions
diff --git a/toolkit/content/customizeToolbar.js b/toolkit/content/customizeToolbar.js index 1ad54f03c..fedc0a624 100644 --- a/toolkit/content/customizeToolbar.js +++ b/toolkit/content/customizeToolbar.js @@ -505,7 +505,7 @@ function addNewToolbar() message = stringBundle.getFormattedString("enterToolbarDup", [name.value]); } - gToolbox.appendCustomToolbar(name.value, ""); + gToolbox.appendCustomToolbar(name.value, "", []); toolboxChanged(); diff --git a/toolkit/content/widgets/toolbar.xml b/toolkit/content/widgets/toolbar.xml index 17158c2c9..353a8c16b 100644 --- a/toolkit/content/widgets/toolbar.xml +++ b/toolkit/content/widgets/toolbar.xml @@ -60,7 +60,18 @@ while (toolbarset.hasAttribute("toolbar"+(++index))) { var toolbarInfo = toolbarset.getAttribute("toolbar"+index); var infoSplit = toolbarInfo.split(":"); - this.appendCustomToolbar(infoSplit[0], infoSplit[1]); + var name = infoSplit[0]; + var currentSet = infoSplit[1]; + var attrsIn = ["collapsed"]; + var attrsOut = []; + for (let i = 0, attrsInLength = attrsIn.length; i < attrsInLength; i++) { + let attr = "toolbar_" + name + "_" + attrsIn[i]; + let value = toolbarset.getAttribute(attr); + if (value) { + attrsOut.push({ "name": attrsIn[i], "value": value }); + } + } + this.appendCustomToolbar(name, currentSet, attrsOut); } } ]]> @@ -69,6 +80,7 @@ <method name="appendCustomToolbar"> <parameter name="aName"/> <parameter name="aCurrentSet"/> + <parameter name="aAttrsOut"/> <body> <![CDATA[ if (!this.toolbarset) @@ -84,7 +96,11 @@ toolbar.setAttribute("iconsize", this.getAttribute("iconsize")); toolbar.setAttribute("context", this.toolbarset.getAttribute("context")); toolbar.setAttribute("class", "chromeclass-toolbar"); - + for (let i = 0, aAttrsOutLength = aAttrsOut.length; i < aAttrsOutLength; i++) { + let attr = aAttrsOut[i]; + toolbar.setAttribute(attr.name, attr.value); + } + this.insertBefore(toolbar, this.toolbarset); return toolbar; ]]> |