An attempt to make the preferences UI a little easier/less cluttered. The styling, the functionality--all this is subject to change as we explore what to do with this panel.

git-svn-id: svn://10.0.0.236/trunk@146285 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blakeross%telocity.com
2003-08-24 04:50:59 +00:00
parent 4c46a0606d
commit 6139602304
4 changed files with 43 additions and 7 deletions

View File

@@ -344,3 +344,13 @@ function onPrefsOK()
}
}
}
function unexpandOld(event)
{
var box = document.getElementById("privacyCategories");
var newExpander = event.originalTarget.parentNode.parentNode;
for (var i = 0; i < box.childNodes.length; ++i) {
if (box.childNodes[i] != newExpander && box.childNodes[i].getAttribute("open"))
box.childNodes[i].open = false;
}
}

View File

@@ -53,9 +53,12 @@
<description>&privacyDescription.label;</description>
<vbox id="privacyCategories" class="listBox settingsBox" flex="1" style="overflow: auto;">
<vbox id="privacyCategories" class="listBox settingsBox" flex="1" style="overflow: auto;"
oncommand="if (event.originalTarget.getAttribute('anonid') == 'disclosure') unexpandOld(event);"
onclick="if (event.originalTarget.getAttribute('anonid') == 'label') unexpandOld(event);">
<!-- History -->
<expander id="history" label="&history.label;" clearlabel="&clearHistory.label;" onclear="clearHistory();" persist="open">
<expander id="history" label="&history.label;" clearlabel="&clearHistory.label;" onclear="clearHistory();"
open="true" persist="open">
<hbox align="center">
<label value="&pageHis.label;" accesskey="&pageHis.accesskey;" control="histDay"/>
<textbox id="histDay" size="3"

View File

@@ -178,4 +178,13 @@
#defaultAppName {
margin-left: 6px !important;
}
expander {
margin: 2px;
}
#privacyCategories > expander[open="true"] {
background-color: #FFFFCC;
border: 1px solid black;
}

View File

@@ -26,6 +26,24 @@
settings.collapsed = !open;
expander.open = open;
]]></constructor>
<property name="open">
<setter>
<![CDATA[
var settings = document.getAnonymousElementByAttribute(this, "anonid", "settings");
var expander = document.getAnonymousElementByAttribute(this, "anonid", "disclosure");
settings.collapsed = !val;
expander.open = val;
if (val)
this.setAttribute("open", "true");
else
this.removeAttribute("open");
return val;
]]>
</setter>
<getter>
return this.getAttribute("open");
</getter>
</property>
<method name="onCommand">
<parameter name="aEvent"/>
<body><![CDATA[
@@ -34,11 +52,7 @@
switch (button) {
case "disclosure":
case "label":
var settings = document.getAnonymousElementByAttribute(this, "anonid", "settings");
settings.collapsed = !settings.collapsed;
var disclosure = document.getAnonymousElementByAttribute(this, "anonid", "disclosure");
disclosure.open = !disclosure.open;
this.setAttribute("open", disclosure.open);
this.open = !this.open;
break;
case "clear-button":
var event = document.createEvent("Events");