Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/app.js
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | components: { | ||||
AppComponent, | AppComponent, | ||||
MenuComponent, | MenuComponent, | ||||
}, | }, | ||||
i18n, | i18n, | ||||
store, | store, | ||||
router: window.router, | router: window.router, | ||||
data() { | data() { | ||||
return { | return { | ||||
isAdmin: window.isAdmin, | isUser: !window.isAdmin && !window.isReseller, | ||||
appName: window.config['app.name'], | appName: window.config['app.name'], | ||||
appUrl: window.config['app.url'], | appUrl: window.config['app.url'], | ||||
themeDir: '/themes/' + window.config['app.theme'] | themeDir: '/themes/' + window.config['app.theme'] | ||||
} | } | ||||
}, | }, | ||||
methods: { | methods: { | ||||
// Clear (bootstrap) form validation state | // Clear (bootstrap) form validation state | ||||
clearFormValidation(form) { | clearFormValidation(form) { | ||||
▲ Show 20 Lines • Show All 366 Lines • ▼ Show 20 Lines | error => { | ||||
const input_name = (form.data('validation-prefix') || form.find('form').first().data('validation-prefix') || '') + idx | const input_name = (form.data('validation-prefix') || form.find('form').first().data('validation-prefix') || '') + idx | ||||
let input = form.find('#' + input_name) | let input = form.find('#' + input_name) | ||||
if (!input.length) { | if (!input.length) { | ||||
input = form.find('[name="' + input_name + '"]'); | input = form.find('[name="' + input_name + '"]'); | ||||
} | } | ||||
if (input.length) { | if (input.length) { | ||||
// Create an error message\ | // Create an error message | ||||
// API responses can use a string, array or object | // API responses can use a string, array or object | ||||
let msg_text = '' | let msg_text = '' | ||||
if ($.type(msg) !== 'string') { | if ($.type(msg) !== 'string') { | ||||
$.each(msg, (index, str) => { | $.each(msg, (index, str) => { | ||||
msg_text += str + ' ' | msg_text += str + ' ' | ||||
}) | }) | ||||
} | } | ||||
else { | else { | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |