Fixed #75 - Time buttons select a date on mouseout event on Calendar with showTime property

pull/104/head
mertsincan 2019-10-22 14:19:24 +03:00
parent e0aa79469d
commit e782515cb8
1 changed files with 9 additions and 6 deletions

View File

@ -63,12 +63,12 @@
<div class="p-timepicker" v-if="showTime||timeOnly"> <div class="p-timepicker" v-if="showTime||timeOnly">
<div class="p-hour-picker"> <div class="p-hour-picker">
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 0, 1)" @mouseup="onTimePickerElementMouseUp($event)" <button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 0, 1)" @mouseup="onTimePickerElementMouseUp($event)"
@mouseout="onTimePickerElementMouseUp($event)"> @mouseleave="onTimePickerElementMouseLeave()">
<span class="pi pi-chevron-up"></span> <span class="pi pi-chevron-up"></span>
</button> </button>
<span :style="{'display': currentHour < 10 ? 'inline': 'none'}">0</span><span>{{currentHour}}</span> <span :style="{'display': currentHour < 10 ? 'inline': 'none'}">0</span><span>{{currentHour}}</span>
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 0, -1)" @mouseup="onTimePickerElementMouseUp($event)" <button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 0, -1)" @mouseup="onTimePickerElementMouseUp($event)"
@mouseout="onTimePickerElementMouseUp($event)"> @mouseleave="onTimePickerElementMouseLeave()">
<span class="pi pi-chevron-down"></span> <span class="pi pi-chevron-down"></span>
</button> </button>
</div> </div>
@ -83,12 +83,12 @@
</div> </div>
<div class="p-minute-picker"> <div class="p-minute-picker">
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 1, 1)" @mouseup="onTimePickerElementMouseUp($event)" <button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 1, 1)" @mouseup="onTimePickerElementMouseUp($event)"
@mouseout="onTimePickerElementMouseUp($event)"> @mouseleave="onTimePickerElementMouseLeave()">
<span class="pi pi-chevron-up"></span> <span class="pi pi-chevron-up"></span>
</button> </button>
<span :style="{'display': currentMinute < 10 ? 'inline': 'none'}">0</span><span>{{currentMinute}}</span> <span :style="{'display': currentMinute < 10 ? 'inline': 'none'}">0</span><span>{{currentMinute}}</span>
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 1, -1)" @mouseup="onTimePickerElementMouseUp($event)" <button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 1, -1)" @mouseup="onTimePickerElementMouseUp($event)"
@mouseout="onTimePickerElementMouseUp($event)"> @mouseleave="onTimePickerElementMouseLeave()">
<span class="pi pi-chevron-down"></span> <span class="pi pi-chevron-down"></span>
</button> </button>
</div> </div>
@ -103,12 +103,12 @@
</div> </div>
<div class="p-second-picker" v-if="showSeconds"> <div class="p-second-picker" v-if="showSeconds">
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 2, 1)" @mouseup="onTimePickerElementMouseUp($event)" <button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 2, 1)" @mouseup="onTimePickerElementMouseUp($event)"
@mouseout="onTimePickerElementMouseUp($event)"> @mouseleave="onTimePickerElementMouseLeave()">
<span class="pi pi-chevron-up"></span> <span class="pi pi-chevron-up"></span>
</button> </button>
<span :style="{'display': currentSecond < 10 ? 'inline': 'none'}">0</span><span>{{currentSecond}}</span> <span :style="{'display': currentSecond < 10 ? 'inline': 'none'}">0</span><span>{{currentSecond}}</span>
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 2, -1)" @mouseup="onTimePickerElementMouseUp($event)" <button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 2, -1)" @mouseup="onTimePickerElementMouseUp($event)"
@mouseout="onTimePickerElementMouseUp($event)"> @mouseleave="onTimePickerElementMouseLeave()">
<span class="pi pi-chevron-down"></span> <span class="pi pi-chevron-down"></span>
</button> </button>
</div> </div>
@ -975,6 +975,9 @@ export default {
event.preventDefault(); event.preventDefault();
} }
}, },
onTimePickerElementMouseLeave() {
this.clearTimePickerTimer();
},
repeat(event, interval, type, direction) { repeat(event, interval, type, direction) {
let i = interval||500; let i = interval||500;