mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 22:43:47 +01:00
- LSformElement_date : Correction d'un bug énervant dans le JS
This commit is contained in:
parent
6e8cc96864
commit
d783a2c840
1 changed files with 29 additions and 2 deletions
|
@ -20,7 +20,8 @@ var LSformElement_date_field = new Class({
|
||||||
this.params.firstDayOfWeek=0;
|
this.params.firstDayOfWeek=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.input.addEvent('click',this.onCalendarBtnClick.bind(this));
|
this.firstInputClick = 1;
|
||||||
|
this.input.addEvent('click',this.onInputClick.bind(this));
|
||||||
|
|
||||||
this.date = Date.parseDate(this.input.value,this.params.format);
|
this.date = Date.parseDate(this.input.value,this.params.format);
|
||||||
|
|
||||||
|
@ -42,16 +43,42 @@ var LSformElement_date_field = new Class({
|
||||||
varLSdefault.addHelpInfo(this.nowBtn,'LSformElement_date','now');
|
varLSdefault.addHelpInfo(this.nowBtn,'LSformElement_date','now');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onInputClick: function() {
|
||||||
|
if(this.firstInputClick==1) {
|
||||||
|
this.toogle();
|
||||||
|
this.firstInputClick=0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onCalendarBtnClick: function() {
|
onCalendarBtnClick: function() {
|
||||||
|
this.toogle();
|
||||||
|
},
|
||||||
|
|
||||||
|
open: function() {
|
||||||
|
this.opened = 1;
|
||||||
this.calendar.showAtElement(this.calendarBtn);
|
this.calendar.showAtElement(this.calendarBtn);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
close: function() {
|
||||||
|
this.opened = 0;
|
||||||
|
this.calendar.hide();
|
||||||
|
},
|
||||||
|
|
||||||
|
toogle: function() {
|
||||||
|
if (this.opened) {
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.open();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onChangeCalendar: function(calendar, date) {
|
onChangeCalendar: function(calendar, date) {
|
||||||
this.input.value = date;
|
this.input.value = date;
|
||||||
},
|
},
|
||||||
|
|
||||||
onCloseCalendar: function() {
|
onCloseCalendar: function() {
|
||||||
this.calendar.hide();
|
this.close();
|
||||||
},
|
},
|
||||||
|
|
||||||
onNowBtnClick: function() {
|
onNowBtnClick: function() {
|
||||||
|
|
Loading…
Reference in a new issue