Bug 260527. Some radio buttons not underlining accesskeys in labels. Relanding toolkit part of patch following aviary branch landing - previously reviewed

This commit is contained in:
aaronleventhal%moonset.net 2004-12-02 21:37:09 +00:00
Родитель eddbb28d7e
Коммит d4e201c3e8
2 изменённых файлов: 15 добавлений и 12 удалений

Просмотреть файл

@ -26,13 +26,13 @@
</getter>
<setter>
<![CDATA[
// If there is a label, store the accesskey on the labelElement
// Always store on the control
this.setAttribute('accesskey', val);
// If there is a label, change the accesskey on the labelElement
// if it's also set there
if (this.labelElement) {
this.labelElement.accessKey = val;
}
else {
this.setAttribute('accesskey', val);
}
return val;
]]>
</setter>

Просмотреть файл

@ -138,24 +138,27 @@
<property name="accessKey">
<getter>
<![CDATA[
var accessKey = this.getAttribute('accesskey');
var accessKey;
var labeledEl = this.labeledControlElement;
if (labeledEl) {
accessKey = labeledEl.getAttribute('accesskey');
}
if (!accessKey) {
var labeledEl = this.labeledControlElement;
if (labeledEl) {
accessKey = labeledEl.getAttribute('accesskey');
}
accessKey = this.getAttribute('accesskey');
}
return accessKey ? accessKey[0] : null;
]]>
</getter>
<setter>
<![CDATA[
// If the control already has an accesskey store it there as well
// If this label already has an accesskey attribute store it here as well
if (this.hasAttribute('accesskey')) {
this.setAttribute('accesskey', val);
}
var control = this.labeledControlElement;
if (control && control.hasAttribute('accesskey')) {
if (control) {
control.setAttribute('accesskey', val);
}
this.setAttribute('accesskey', val);
this.formatAccessKey();
return val;
]]>