add loader a folder is opened
This commit is contained in:
parent
dce71527bd
commit
0693559449
|
@ -5,6 +5,11 @@
|
||||||
<li class="breadcrumb-item" v-for="item in breadcrumb">
|
<li class="breadcrumb-item" v-for="item in breadcrumb">
|
||||||
<a class="btn btn-sm" href="#" v-on:click="setDirectory(item.path)" v-html="item.label"></a>
|
<a class="btn btn-sm" href="#" v-on:click="setDirectory(item.path)" v-html="item.label"></a>
|
||||||
</li>
|
</li>
|
||||||
|
<li v-if="isLoading" class="ml-3">
|
||||||
|
<div class="spinner-border spinner-border-sm" role="status">
|
||||||
|
<span class="sr-only">Loading...</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
|
@ -200,7 +205,8 @@ export default {
|
||||||
files: [],
|
files: [],
|
||||||
parent: null,
|
parent: null,
|
||||||
modalUrl: null,
|
modalUrl: null,
|
||||||
ajax: 0
|
ajax: 0,
|
||||||
|
isLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -266,6 +272,7 @@ export default {
|
||||||
},
|
},
|
||||||
refresh () {
|
refresh () {
|
||||||
const that = this
|
const that = this
|
||||||
|
this.isLoading = true
|
||||||
|
|
||||||
axios.get(Routing.generate('admin_file_manager_api_directory', {
|
axios.get(Routing.generate('admin_file_manager_api_directory', {
|
||||||
directory: that.directory,
|
directory: that.directory,
|
||||||
|
@ -277,6 +284,7 @@ export default {
|
||||||
that.parent = response.data.parent
|
that.parent = response.data.parent
|
||||||
that.directories = response.data.directories
|
that.directories = response.data.directories
|
||||||
that.files = response.data.files
|
that.files = response.data.files
|
||||||
|
that.isLoading = false
|
||||||
|
|
||||||
const query = new URLSearchParams(window.location.search)
|
const query = new URLSearchParams(window.location.search)
|
||||||
query.set('path', that.directory)
|
query.set('path', that.directory)
|
||||||
|
@ -285,7 +293,7 @@ export default {
|
||||||
null,
|
null,
|
||||||
'',
|
'',
|
||||||
window.location.pathname + '?' + query.toString()
|
window.location.pathname + '?' + query.toString()
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
alert('An error occured')
|
alert('An error occured')
|
||||||
|
|
Loading…
Reference in a new issue