зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1320225 - [DateTimeInput] Integration of input type=date input box with picker (part 1). r=mconley,smaug
This commit is contained in:
Родитель
2a6cfd0c07
Коммит
1f0dcc2334
|
@ -240,6 +240,9 @@ partial interface HTMLInputElement {
|
|||
dictionary DateTimeValue {
|
||||
long hour;
|
||||
long minute;
|
||||
long year;
|
||||
long month;
|
||||
long day;
|
||||
};
|
||||
|
||||
partial interface HTMLInputElement {
|
||||
|
|
|
@ -1736,6 +1736,7 @@ let DateTimePickerListener = {
|
|||
}
|
||||
case "MozUpdateDateTimePicker": {
|
||||
let value = this._inputElement.getDateTimeInputBoxValue();
|
||||
value.type = this._inputElement.type;
|
||||
sendAsyncMessage("FormDateTime:UpdatePicker", { value });
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -199,10 +199,24 @@
|
|||
</method>
|
||||
|
||||
<method name="setFieldsFromPicker">
|
||||
<parameter name="aValue"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
// TODO: Bug 1320225 - [DateTimeInput] Integration of input type=date
|
||||
// input box with picker.
|
||||
let year = aValue.year;
|
||||
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>
|
||||
</method>
|
||||
|
|
|
@ -97,13 +97,10 @@ this.DateTimePickerHelper = {
|
|||
|
||||
// Called when picker value has changed, notify input box about it.
|
||||
updateInputBoxValue(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;
|
||||
if (browser) {
|
||||
browser.messageManager.sendAsyncMessage(
|
||||
"FormDateTime:PickerValueChanged", { hour, minute });
|
||||
"FormDateTime:PickerValueChanged", aEvent.detail);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче