Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/app.js
Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | methods: { | ||||
link.href = window.URL.createObjectURL(response.data) | link.href = window.URL.createObjectURL(response.data) | ||||
link.download = filename | link.download = filename | ||||
link.click() | link.click() | ||||
}) | }) | ||||
}, | }, | ||||
price(price, currency) { | price(price, currency) { | ||||
return ((price || 0) / 100).toLocaleString('de-DE', { style: 'currency', currency: currency || 'CHF' }) | return ((price || 0) / 100).toLocaleString('de-DE', { style: 'currency', currency: currency || 'CHF' }) | ||||
}, | }, | ||||
priceLabel(cost, units = 1, discount) { | priceLabel(cost, discount) { | ||||
let index = '' | let index = '' | ||||
if (units < 0) { | |||||
units = 1 | |||||
} | |||||
if (discount) { | if (discount) { | ||||
cost = Math.floor(cost * ((100 - discount) / 100)) | cost = Math.floor(cost * ((100 - discount) / 100)) | ||||
index = '\u00B9' | index = '\u00B9' | ||||
} | } | ||||
return this.price(cost * units) + '/month' + index | return this.price(cost) + '/month' + index | ||||
}, | }, | ||||
clickRecord(event) { | clickRecord(event) { | ||||
if (!/^(a|button|svg|path)$/i.test(event.target.nodeName)) { | if (!/^(a|button|svg|path)$/i.test(event.target.nodeName)) { | ||||
let link = $(event.target).closest('tr').find('a')[0] | let link = $(event.target).closest('tr').find('a')[0] | ||||
if (link) { | if (link) { | ||||
link.click() | link.click() | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |