mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-30 19:17:31 +09:00
Bug 1320225: [DateTimeInput] Integration of input type=date input box with picker (part 2)
This commit is contained in:
parent
d8bcf2270a
commit
753a28d239
4 changed files with 21 additions and 6 deletions
|
|
@ -238,6 +238,9 @@ partial interface HTMLInputElement {
|
||||||
dictionary DateTimeValue {
|
dictionary DateTimeValue {
|
||||||
long hour;
|
long hour;
|
||||||
long minute;
|
long minute;
|
||||||
|
long year;
|
||||||
|
long month;
|
||||||
|
long day;
|
||||||
};
|
};
|
||||||
|
|
||||||
partial interface HTMLInputElement {
|
partial interface HTMLInputElement {
|
||||||
|
|
|
||||||
|
|
@ -1737,6 +1737,7 @@ let DateTimePickerListener = {
|
||||||
}
|
}
|
||||||
case "MozUpdateDateTimePicker": {
|
case "MozUpdateDateTimePicker": {
|
||||||
let value = this._inputElement.getDateTimeInputBoxValue();
|
let value = this._inputElement.getDateTimeInputBoxValue();
|
||||||
|
value.type = this._inputElement.type;
|
||||||
sendAsyncMessage("FormDateTime:UpdatePicker", { value });
|
sendAsyncMessage("FormDateTime:UpdatePicker", { value });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -199,10 +199,24 @@
|
||||||
</method>
|
</method>
|
||||||
|
|
||||||
<method name="setFieldsFromPicker">
|
<method name="setFieldsFromPicker">
|
||||||
|
<parameter name="aValue"/>
|
||||||
<body>
|
<body>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
// TODO: Bug 1320225 - [DateTimeInput] Integration of input type=date
|
let year = aValue.year;
|
||||||
// input box with picker.
|
let month = aValue.month;
|
||||||
|
let day = aValue.day;
|
||||||
|
|
||||||
|
if (!this.isEmpty(year)) {
|
||||||
|
this.setFieldValue(this.mYearField, year);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.isEmpty(month)) {
|
||||||
|
this.setFieldValue(this.mMonthField, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.isEmpty(day)) {
|
||||||
|
this.setFieldValue(this.mDayField, day);
|
||||||
|
}
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
</method>
|
</method>
|
||||||
|
|
|
||||||
|
|
@ -97,13 +97,10 @@ this.DateTimePickerHelper = {
|
||||||
|
|
||||||
// Called when picker value has changed, notify input box about it.
|
// Called when picker value has changed, notify input box about it.
|
||||||
updateInputBoxValue: function(aEvent) {
|
updateInputBoxValue: function(aEvent) {
|
||||||
// TODO: parse data based on input type.
|
|
||||||
const { hour, minute } = aEvent.detail;
|
|
||||||
debug("hour: " + hour + ", minute: " + minute);
|
|
||||||
let browser = this.weakBrowser ? this.weakBrowser.get() : null;
|
let browser = this.weakBrowser ? this.weakBrowser.get() : null;
|
||||||
if (browser) {
|
if (browser) {
|
||||||
browser.messageManager.sendAsyncMessage(
|
browser.messageManager.sendAsyncMessage(
|
||||||
"FormDateTime:PickerValueChanged", { hour, minute });
|
"FormDateTime:PickerValueChanged", aEvent.detail);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue