зеркало из https://github.com/mozilla/pjs.git
[XForms] Expose base bindings for select widgets. Bug 323849, r=doronr+aaronr, patch by surkov@dc.baikal.ru
This commit is contained in:
Родитель
d0aee47716
Коммит
00078eb11b
|
@ -18,6 +18,7 @@ xforms.jar:
|
|||
content/xforms/select1.xml (resources/content/select1.xml)
|
||||
content/xforms/range.xml (resources/content/range.xml)
|
||||
content/xforms/select.xml (resources/content/select.xml)
|
||||
content/xforms/select-xhtml.xml (resources/content/select-xhtml.xml)
|
||||
content/xforms/bindingex.css (resources/content/bindingex.css)
|
||||
content/xforms/bindingex.xul (resources/content/bindingex.xul)
|
||||
content/xforms/calendar.png (resources/content/calendar.png)
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -127,6 +127,7 @@
|
|||
getAnonymousElementByAttribute(this, "anonid", 'implicitcontent'),
|
||||
_explicitContent: this.ownerDocument.
|
||||
getAnonymousElementByAttribute(this, 'anonid', 'explicitcontent'),
|
||||
__proto__: this,
|
||||
|
||||
set value(val) {
|
||||
if (val != null) {
|
||||
|
@ -136,6 +137,26 @@
|
|||
this._implicitContent.textContent = '';
|
||||
this._explicitContent.style.display = 'inline';
|
||||
}
|
||||
},
|
||||
|
||||
get textValue() {
|
||||
if (this._explicitContent.style.display == 'none')
|
||||
return this._implicitContent.textContent;
|
||||
return this.textContent;
|
||||
},
|
||||
get nodeValue() {
|
||||
var fragment = this.ownerDocument.createDocumentFragment();
|
||||
|
||||
var container = null;
|
||||
if (this._explicitContent.style.display == 'none')
|
||||
container = this._implicitContent;
|
||||
else
|
||||
container = this;
|
||||
|
||||
for (var node = container.firstChild; node; node = node.nextSibling) {
|
||||
fragment.appendChild(node.cloneNode(true));
|
||||
}
|
||||
return fragment;
|
||||
}
|
||||
};
|
||||
</body>
|
||||
|
|
|
@ -468,12 +468,18 @@ case > html|div.-moz-xforms-case-container {
|
|||
}
|
||||
|
||||
/* select */
|
||||
select {
|
||||
-moz-binding: url('chrome://xforms/content/select.xml#xformswidget-select');
|
||||
html|*:root select {
|
||||
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#xformswidget-select-compact');
|
||||
}
|
||||
html|*:root select html|span[anonid="control"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#widget-select-compact');
|
||||
}
|
||||
|
||||
select[appearance="full"] {
|
||||
-moz-binding: url('chrome://xforms/content/select.xml#xformswidget-select-full');
|
||||
html|*:root select[appearance="full"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#xformswidget-select-full');
|
||||
}
|
||||
html|*:root select[appearance="full"] html|span[anonid="control"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#widget-select-full');
|
||||
}
|
||||
|
||||
select html|div.select-choice-label {
|
||||
|
|
|
@ -171,6 +171,7 @@
|
|||
<destructor>
|
||||
this._delegate = null;
|
||||
this._accessors = null;
|
||||
this._control = null;
|
||||
</destructor>
|
||||
|
||||
<property name="delegate" readonly="true">
|
||||
|
@ -216,6 +217,8 @@
|
|||
method what returns the object:
|
||||
{
|
||||
set value(); // set "string" value
|
||||
get textValue() // return text representing label value
|
||||
get nodeValue() // return document fragment representing label value
|
||||
}
|
||||
-->
|
||||
<binding id="xformswidget-label-base"
|
||||
|
@ -229,6 +232,11 @@
|
|||
</body>
|
||||
</method>
|
||||
|
||||
<property name="textValue" readonly="true"
|
||||
onget="return this.control.textValue;"/>
|
||||
|
||||
<property name="nodeValue" readonly="true"
|
||||
onget="return this.control.nodeValue;"/>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче