- Remove external JS and CSS dependencies - Use Vuejs runtime - Add xss sanitizer - Normalize Laravel mix + add cleaner - Update npm deps - Upgrade bootswatch theme
31 lines
1.3 KiB
JavaScript
Vendored
31 lines
1.3 KiB
JavaScript
Vendored
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
// Page Project File Add
|
|
if (document.querySelector('.content.pageFile')) {
|
|
let selectFileType = document.getElementById('type'),
|
|
inputUri = document.getElementById('uri'),
|
|
inputFile = document.getElementById('file')
|
|
|
|
|
|
let changeFields = () => {
|
|
if (selectFileType.value == 0) {
|
|
inputUri.attributes['required'] = true
|
|
inputUri.attributes['disabled'] = false
|
|
inputUri.parentElement.parentElement.classList.remove('d-none')
|
|
inputFile.attributes['required'] = false
|
|
inputFile.attributes['disabled'] = true
|
|
inputFile.parentElement.parentElement.classList.add('d-none')
|
|
} else {
|
|
inputUri.attributes['required'] = false
|
|
inputUri.attributes['disabled'] = true
|
|
inputUri.parentElement.parentElement.classList.add('d-none')
|
|
inputFile.attributes['required'] = true
|
|
inputFile.attributes['disabled'] = false
|
|
inputFile.parentElement.parentElement.classList.remove('d-none')
|
|
}
|
|
}
|
|
|
|
changeFields()
|
|
selectFileType.addEventListener('change', changeFields)
|
|
}
|
|
})
|