frontello-ui-datepicker
Advanced tools
Comparing version 3.0.6 to 3.0.7
@@ -52,10 +52,18 @@ "use strict"; | ||
this.field.addEventListener('change', () => { | ||
this._renderInputType(); | ||
this._renderInputType(true); | ||
this._loadInputDate(false); | ||
}); | ||
this.field.addEventListener('focus', () => { | ||
this._renderInputType(true); | ||
}); | ||
this.field.addEventListener('focusout', () => { | ||
this._renderInputType(); | ||
}); | ||
} | ||
_renderInputType() | ||
_renderInputType(forceDate = false) | ||
{ | ||
if (this.date == null) { | ||
if (this.date == null && !forceDate) { | ||
this.field.type = 'text'; | ||
@@ -69,2 +77,6 @@ } else { | ||
} | ||
if (this.config.debug) { | ||
console.log('Input type : ' + this.field.type); | ||
} | ||
} | ||
@@ -524,5 +536,5 @@ | ||
this.config.dateChange(this); | ||
if (eventChange) { | ||
this.config.dateChange(this); | ||
this.field.dispatchEvent(new Event('change')); | ||
@@ -990,3 +1002,3 @@ } | ||
}); | ||
this.controls .append(this.actionClear); | ||
this.controls.append(this.actionClear); | ||
@@ -998,3 +1010,3 @@ this.dateLabel = document.createElement('span'); | ||
}); | ||
this.controls .append(this.dateLabel); | ||
this.controls.append(this.dateLabel); | ||
@@ -1008,3 +1020,3 @@ this.actionValidate = document.createElement('a'); | ||
}); | ||
this.controls .append(this.actionValidate); | ||
this.controls.append(this.actionValidate); | ||
} | ||
@@ -1011,0 +1023,0 @@ |
{ | ||
"name": "frontello-ui-datepicker", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "Efficient vanilla datepicker", | ||
@@ -5,0 +5,0 @@ "main": "datepicker.js", |
33505
1059