зеркало из https://github.com/mozilla/pjs.git
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.
This commit is contained in:
Родитель
b807f60065
Коммит
87166ec986
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
|
|
|
@ -179,3 +179,12 @@
|
|||
#defaultAppName {
|
||||
margin-left: 6px !important;
|
||||
}
|
||||
|
||||
expander {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
#privacyCategories > expander[open="true"] {
|
||||
background-color: #FFFFCC;
|
||||
border: 1px solid black;
|
||||
}
|
|
@ -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");
|
||||
|
|
Загрузка…
Ссылка в новой задаче