mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Checked in patches for bug 250824
This commit is contained in:
parent
2a5dc4d585
commit
1205882021
@ -118,6 +118,11 @@
|
||||
onset="this.update(val,false)"
|
||||
onget="return this.mValue"/>
|
||||
|
||||
<!-- called from datetimepicker.datepickerdisabled and datetimepicker.setDisabled -->
|
||||
<property name="disabled"
|
||||
onget="return this.mDisabled;"
|
||||
onset="this.setDisabled( val );" />
|
||||
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
//var hbox = document.getAnonymousElementByAttribute(this,"id","hbox");
|
||||
@ -127,11 +132,16 @@
|
||||
// Fails:
|
||||
// this.kTextBoxInput = document.getAnonymousNodes(this.kTextBox).childNodes[0].childNodes[0];
|
||||
// this.kTextBoxInput.kDatePicker = this;
|
||||
this.kPopup = hbox.childNodes[1].childNodes[0];
|
||||
this.kCalendar = this.kPopup.childNodes[0];
|
||||
this.kCalendar.kDatePicker = this; // enable call back to method in Moz1.6
|
||||
//document.getAnonymousElementByAttribute(this, "id", "button");
|
||||
this.kButton = hbox.childNodes[1];
|
||||
this.kPopup = kButton.childNodes[0];
|
||||
this.kMinimonth = this.kPopup.childNodes[0];
|
||||
this.kMinimonth.kDatePicker = this; // enable call back to method in Moz1.6
|
||||
this.kFormatter = new DateFormater();
|
||||
|
||||
// whether currently disabled
|
||||
this.mDisabled = this.getAttribute("disabled") ? true : false;
|
||||
|
||||
this.mValue = null;
|
||||
var val = this.getAttribute("value");
|
||||
if (val) {
|
||||
@ -146,8 +156,8 @@
|
||||
</constructor>
|
||||
|
||||
<method name="update">
|
||||
<parameter name="aValue"/>
|
||||
<parameter name="refresh"/>
|
||||
<parameter name="aValue"/>
|
||||
<parameter name="refresh"/>
|
||||
<body><![CDATA[
|
||||
if (aValue == null) { // invalid date, revert to previous date
|
||||
// set textBox.value property, not attribute
|
||||
@ -163,12 +173,26 @@
|
||||
</method>
|
||||
|
||||
<method name="formatDate">
|
||||
<parameter name="aValue"/>
|
||||
<parameter name="aValue"/>
|
||||
<body><![CDATA[
|
||||
return this.kFormatter.getShortFormatedDate(aValue);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="setDisabled">
|
||||
<parameter name="aDisabled" />
|
||||
<body><![CDATA[
|
||||
this.mDisabled = aDisabled;
|
||||
if (this.mDisabled) {
|
||||
this.kTextBox.setAttribute( "disabled", "true" );
|
||||
this.kButton.setAttribute( "disabled", "true" );
|
||||
} else {
|
||||
this.kTextBox.removeAttribute( "disabled" );
|
||||
this.kButton.removeAttribute( "disabled" );
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="onPopup">
|
||||
<body><![CDATA[
|
||||
var cal = this.kPopup.childNodes[0];
|
||||
|
@ -127,6 +127,7 @@
|
||||
onget="return this.mValue"
|
||||
onset="this.update(val,false)" />
|
||||
|
||||
<!-- called from datetimepicker.timepickerdisabled and datetimepicker.setDisabled -->
|
||||
<property name="disabled"
|
||||
onget="return this.mDisabled;"
|
||||
onset="this.setDisabled( val );" />
|
||||
@ -142,7 +143,7 @@
|
||||
this.kFormatter = new DateFormater();
|
||||
|
||||
// whether currently disabled
|
||||
this.mDisabled = false;
|
||||
this.mDisabled = this.getAttribute("disabled") ? true : false;
|
||||
|
||||
var val = this.getAttribute("value");
|
||||
if (val) update(new Date(val), false);
|
||||
@ -193,15 +194,11 @@
|
||||
<body><![CDATA[
|
||||
this.mDisabled = aDisabled;
|
||||
if (this.mDisabled) {
|
||||
// disable popups by removing the popup attribute
|
||||
this.kTextBox.setAttribute( "disabled", "true" );
|
||||
this.kButton.setAttribute( "disabled", "true" );
|
||||
//this.kButton.removeAttribute( "popup" );
|
||||
} else {
|
||||
// enable popups by setting the popup attribute
|
||||
this.kTextBox.removeAttribute( "disabled" );
|
||||
this.kButton.removeAttribute( "disabled" );
|
||||
//this.kButton.setAttribute( "popup", "oe-time-picker-popup" );
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
Loading…
Reference in New Issue
Block a user