bug fixed in datePicker, onclick action added
This commit is contained in:
parent
78f4685001
commit
4667b39b1a
|
@ -4,7 +4,8 @@
|
|||
ng-focus="$ctrl.hasFocus = true"
|
||||
ng-blur="$ctrl.hasFocus = false"
|
||||
ng-mouseenter="$ctrl.hasMouseIn = true"
|
||||
ng-mouseleave="$ctrl.hasMouseIn = false"
|
||||
ng-mouseleave="$ctrl.hasMouseIn = false"
|
||||
ng-click="$ctrl.onClick()"
|
||||
>
|
||||
<input type="text"
|
||||
class="mdl-textfield__input"
|
||||
|
|
|
@ -59,6 +59,11 @@ class DatePicker extends Component {
|
|||
onClear() {
|
||||
this.modelView = null;
|
||||
}
|
||||
onClick() {
|
||||
if (this.vp) {
|
||||
this.vp.open();
|
||||
}
|
||||
}
|
||||
mdlUpdate() {
|
||||
let mdlField = this.element.firstChild.MaterialTextfield;
|
||||
if (mdlField)
|
||||
|
@ -167,14 +172,23 @@ class DatePicker extends Component {
|
|||
return this.iniOptions;
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
initPicker() {
|
||||
this.iniOptions = this._getOptions();
|
||||
this.isTimePicker = (this.iniOptions && this.iniOptions.enableTime && this.iniOptions.noCalendar);
|
||||
this.vp = new Flatpickr(this.input, this.iniOptions);
|
||||
}
|
||||
$onDestroy() {
|
||||
destroyPicker() {
|
||||
if (this.vp)
|
||||
this.vp.destroy();
|
||||
this.vp = undefined;
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
this.initPicker();
|
||||
}
|
||||
|
||||
$onDestroy() {
|
||||
this.destroyPicker();
|
||||
}
|
||||
}
|
||||
DatePicker.$inject = ['$element', '$translate', '$filter', '$timeout'];
|
||||
|
|
Loading…
Reference in New Issue