зеркало из https://github.com/mozilla/pjs.git
Bug 98595 Ability to disable lists/trees/outliners completely Toolkit verison of patch v0.3a
p=me/neil.parkwaycc.co.uk r=mkaply
This commit is contained in:
Родитель
050c6ebfdd
Коммит
26c8126971
|
@ -59,6 +59,11 @@
|
|||
|
||||
<!-- ///////////////// public listbox members ///////////////// -->
|
||||
|
||||
<property name="disabled" onset="if (val) this.setAttribute('disabled', 'true');
|
||||
else this.removeAttribute('disabled');
|
||||
return val;"
|
||||
onget="return this.hasAttribute('disabled');"/>
|
||||
|
||||
<property name="listBoxObject"
|
||||
onget="return this.boxObject.QueryInterface(Components.interfaces.nsIListBoxObject);"
|
||||
readonly="true"/>
|
||||
|
@ -804,6 +809,7 @@
|
|||
click, so that drags work correctly. -->
|
||||
<handler event="mousedown">
|
||||
<![CDATA[
|
||||
if (this.parentNode.disabled) return;
|
||||
if (!event.ctrlKey && !event.shiftKey && !event.metaKey) {
|
||||
if (!this.selected) {
|
||||
parentNode.selectItem(this);
|
||||
|
@ -815,9 +821,9 @@
|
|||
|
||||
<!-- On a click (up+down on the same item), deselect everything
|
||||
except this item. -->
|
||||
<handler event="click">
|
||||
<handler event="click" button="0">
|
||||
<![CDATA[
|
||||
if (event.button != 0) return;
|
||||
if (this.parentNode.disabled) return;
|
||||
if (parentNode.selType != "multiple") {
|
||||
parentNode.selectItem(this);
|
||||
}
|
||||
|
@ -893,7 +899,12 @@
|
|||
</implementation>
|
||||
|
||||
<handlers>
|
||||
<handler event="mousedown" button="0" action="if (!this.disabled) this.checked = !this.checked;"/>
|
||||
<handler event="mousedown" button="0">
|
||||
<![CDATA[
|
||||
if (!this.disabled && !this.parentNode.disabled)
|
||||
this.checked = !this.checked;
|
||||
]]>
|
||||
</handler>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
|
|
|
@ -56,6 +56,10 @@ listbox {
|
|||
color: -moz-FieldText;
|
||||
}
|
||||
|
||||
listbox[disabled="true"] {
|
||||
color: GrayText;
|
||||
}
|
||||
|
||||
/* ::::: listitem ::::: */
|
||||
|
||||
listitem {
|
||||
|
@ -164,4 +168,4 @@ listheader[sortable="true"]:hover:active {
|
|||
|
||||
.listcell-check[disabled="true"][checked="true"] {
|
||||
background-image: url("chrome://global/skin/checkbox/cbox-check-dis.gif");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,10 @@ listbox {
|
|||
color: -moz-FieldText;
|
||||
}
|
||||
|
||||
listbox[disabled="true"] {
|
||||
color: GrayText;
|
||||
}
|
||||
|
||||
/* ::::: listitem ::::: */
|
||||
|
||||
listitem {
|
||||
|
@ -164,4 +168,4 @@ listheader[sortable="true"]:hover:active {
|
|||
|
||||
.listcell-check[disabled="true"][checked="true"] {
|
||||
background-image: url("chrome://global/skin/checkbox/cbox-check-dis.gif");
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче