Source code

Revision control

Other Tools

1
<?xml version="1.0"?>
2
<!-- This Source Code Form is subject to the terms of the Mozilla Public
3
- License, v. 2.0. If a copy of the MPL was not distributed with this
4
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5
6
7
<bindings id="generalBindings"
10
xmlns:xbl="http://www.mozilla.org/xbl">
11
12
<binding id="basecontrol">
13
<implementation implements="nsIDOMXULControlElement">
14
<!-- public implementation -->
15
<property name="disabled" onset="if (val) this.setAttribute('disabled', 'true');
16
else this.removeAttribute('disabled');
17
return val;"
18
onget="return this.getAttribute('disabled') == 'true';"/>
19
<property name="tabIndex" onget="return parseInt(this.getAttribute('tabindex')) || 0"
20
onset="if (val) this.setAttribute('tabindex', val);
21
else this.removeAttribute('tabindex'); return val;"/>
22
</implementation>
23
</binding>
24
25
<binding id="basetext" extends="chrome://global/content/bindings/general.xml#basecontrol">
26
<implementation>
27
<!-- public implementation -->
28
<property name="label" onset="this.setAttribute('label',val); return val;"
29
onget="return this.getAttribute('label');"/>
30
<property name="crop" onset="this.setAttribute('crop',val); return val;"
31
onget="return this.getAttribute('crop');"/>
32
<property name="image" onset="this.setAttribute('image',val); return val;"
33
onget="return this.getAttribute('image');"/>
34
<property name="command" onset="this.setAttribute('command',val); return val;"
35
onget="return this.getAttribute('command');"/>
36
<property name="accessKey">
37
<getter>
38
<![CDATA[
39
return this.getAttribute("accesskey");
40
]]>
41
</getter>
42
<setter>
43
<![CDATA[
44
// Always store on the control
45
this.setAttribute("accesskey", val);
46
// If there is a label, change the accesskey on the labelElement
47
// if it's also set there
48
let labelElement = document.getElementsByAttribute("control", this.id)[0];
49
if (labelElement) {
50
labelElement.setAttribute("accesskey", val);
51
}
52
return val;
53
]]>
54
</setter>
55
</property>
56
</implementation>
57
</binding>
58
59
</bindings>