Fix 'out of stack' issue in ie
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
<tbody>
|
||||
<tr v-for="(row, index) of availableRooms">
|
||||
<td>{{ row.label }}</td>
|
||||
<td style="white-space: nowrap">ab {{ calculatePrice(row.code, selectedNumberOfDays) }} €</td>
|
||||
<td style="white-space: nowrap">ab {{ calculatePrice(row.code) }} €</td>
|
||||
<td>
|
||||
<i v-if="row.skipassIncluded" data-placement="top" title="Skipass inklusive" class="fa fa-tag tooltiptoggle"></i>
|
||||
<a href="#" data-toggle="modal"
|
||||
@@ -90,6 +90,8 @@
|
||||
displayedTo: dayjs().endOf('month'),
|
||||
selectedFrom: null,
|
||||
selectedTo: null,
|
||||
selectedNumberOfNights: 0,
|
||||
minNightsForSelectedDate: 0,
|
||||
availableDates: [],
|
||||
availableRooms: []
|
||||
}
|
||||
@@ -132,26 +134,10 @@
|
||||
}
|
||||
if (this.selectedFrom && this.selectedTo) {
|
||||
label += ' ' + this.selectedFrom.format('DD.MM.YY') + ' - ' + this.selectedTo.format('DD.MM.YY');
|
||||
label += ' (' + this.selectedNumberOfDays + ' Nächte)';
|
||||
label += ' (' + this.selectedNumberOfNights + ' Nächte)';
|
||||
}
|
||||
return label;
|
||||
},
|
||||
selectedNumberOfDays () {
|
||||
if (this.selectedFrom === null || this.selectedTo === null) {
|
||||
return 0;
|
||||
}
|
||||
return this.selectedTo.diff(this.selectedFrom, 'days');
|
||||
},
|
||||
minNightsForSelectedDate () {
|
||||
if (this.selectedFrom === null) {
|
||||
return 0;
|
||||
}
|
||||
const key = this.selectedFrom.format('YYYY-MM-DD');
|
||||
if (!key in this.availableDates) {
|
||||
return 0;
|
||||
}
|
||||
return this.availableDates[key].minNights;
|
||||
},
|
||||
message () {
|
||||
if (this.loading) {
|
||||
return '';
|
||||
@@ -159,9 +145,8 @@
|
||||
if (this.selectedFrom === null || this.selectedTo === null) {
|
||||
return 'Bitte einen Zeitraum auswählen.';
|
||||
}
|
||||
const minNights = this.minNightsForSelectedDate;
|
||||
if (this.selectedNumberOfDays < minNights) {
|
||||
return 'Bitte mindestens ' + minNights + ' Nächte auswählen.';
|
||||
if (this.selectedNumberOfNights < this.minNightsForSelectedDate) {
|
||||
return 'Bitte mindestens ' + this.minNightsForSelectedDate + ' Nächte auswählen.';
|
||||
}
|
||||
if (this.availableRooms.length === 0) {
|
||||
return 'Im gewählten Zeitraum sind leider keine Zimmer verfügbar.';
|
||||
@@ -208,14 +193,32 @@
|
||||
EventBus.$emit('tableLoaded');
|
||||
}, 'json');
|
||||
},
|
||||
calculatePrice (roomCode, nights) {
|
||||
calculatePrice (roomCode) {
|
||||
const room = this.availableRooms.find(obj => {
|
||||
return obj.code === roomCode;
|
||||
});
|
||||
if (room) {
|
||||
const nights = this.getSelectedNumberOfNights();
|
||||
return room.price + (nights - room.minNights) * room.additionalNightPrice;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
getMinNightsForSelectedDate () {
|
||||
if (this.selectedFrom === null) {
|
||||
return 0;
|
||||
}
|
||||
const key = this.selectedFrom.format('YYYY-MM-DD');
|
||||
if (!key in this.availableDates) {
|
||||
return 0;
|
||||
}
|
||||
return this.availableDates[key].minNights;
|
||||
},
|
||||
getSelectedNumberOfNights () {
|
||||
if (this.selectedFrom === null || this.selectedTo === null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return this.selectedTo.diff(this.selectedFrom, 'days');
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
@@ -229,14 +232,16 @@
|
||||
if (selectedDates.length === 2) {
|
||||
this.selectedFrom = dayjs(selectedDates[0]);
|
||||
this.selectedTo = dayjs(selectedDates[1]);
|
||||
if (this.selectedNumberOfDays >= this.minNightsForSelectedDate) {
|
||||
this.selectedNumberOfNights = this.getSelectedNumberOfNights();
|
||||
this.minNightsForSelectedDate = this.getMinNightsForSelectedDate();
|
||||
if (this.selectedNumberOfNights >= this.minNightsForSelectedDate) {
|
||||
this.fetchAvailableRooms();
|
||||
}
|
||||
}
|
||||
},
|
||||
onDayCreate: (dObj, dStr, fp, dayElem) => {
|
||||
const day = dayElem.dateObj.getFullYear() + "-" + ("0" + dayElem.dateObj.getMonth()).slice(-2)
|
||||
+ "-" + ("0"+(dayElem.dateObj.getDate()+1)).slice(-2);
|
||||
const day = dayElem.dateObj.getFullYear() + "-" + ("0" + (dayElem.dateObj.getMonth()+1)).slice(-2)
|
||||
+ "-" + ("0" + dayElem.dateObj.getDate()).slice(-2);
|
||||
if (day in this.availableDates) {
|
||||
dayElem.classList.add('available');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user