Add file manager refresh without reload; ❤️ @parkervcp

This commit is contained in:
Dane Everitt 2016-10-21 18:09:35 -04:00
parent 6b89dbd451
commit 6b011fcd36
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 11 additions and 2 deletions

View file

@ -20,7 +20,7 @@
<table class="table table-hover" id="file_listing">
<thead>
<tr>
<th style="width:2%;text-align:center;"></th>
<th style="width:2%;text-align:center;"><i class="fa fa-refresh muted muted-hover use-pointer" data-action="reload-files"></i></th>
<th style="width:45%">File Name</th>
<th style="width:15%">Size</th>
<th style="width:20%">Last Modified</th>

View file

@ -43,6 +43,7 @@ class FileManager {
this.loader(false);
$('#load_files').slideUp().html(data).slideDown(100, () => {
ContextMenu.run();
this.reloadFilesButton();
if (_.isFunction(next)) {
return next();
}
@ -59,7 +60,7 @@ class FileManager {
text: 'An error occured while attempting to process this request. Please try again.',
});
console.log(jqXHR);
})
});
}
loader(show) {
@ -83,6 +84,13 @@ class FileManager {
}
}
reloadFilesButton() {
$('i[data-action="reload-files"]').unbind().on('click', () => {
$('i[data-action="reload-files"]').addClass('fa-spin');
this.list();
});
}
decodeHash() {
return decodeURIComponent(window.location.hash.substring(1));
}