datatable.directory codebase
https://datatable.directory/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
386 B
21 lines
386 B
6 years ago
|
function busy (yes) {
|
||
|
$('#draft-busy').css('opacity', yes ? 1 : 0)
|
||
|
}
|
||
|
|
||
|
function query (route, data, sucfn, erfn) {
|
||
|
busy(true)
|
||
|
if (!sucfn) sucfn = () => {}
|
||
|
if (!sucfn) erfn = () => {}
|
||
|
window.axios.post(route, data).then(sucfn).catch((error) => {
|
||
|
console.error(error.message)
|
||
|
erfn(error.response.data)
|
||
|
}).then(() => {
|
||
|
busy(false)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export {
|
||
|
busy,
|
||
|
query
|
||
|
}
|