add better loading behaviour for file browser

This commit is contained in:
Sanj 2011-07-06 03:59:43 +05:30
parent abd7fd7100
commit 70680ca4bb
2 changed files with 16 additions and 7 deletions

View File

@ -14,9 +14,15 @@ $(function() {
e.preventDefault(); e.preventDefault();
var formData = $(this).serializeArray(); var formData = $(this).serializeArray();
$('#submitFilter').val("Loading...").attr("disabled", "disabled"); $('#submitFilter').val("Loading...").attr("disabled", "disabled");
$('#pageData').hide();
$('#loadingPage').show();
$('#pageBtnsWrapper').hide();
$('#previewPane').empty(); $('#previewPane').empty();
$.post("/files/json_list", formData, function(data) { $.post("/files/json_list", formData, function(data) {
$('#submitFilter').val(" Find ").removeAttr("disabled"); $('#submitFilter').val(" Find ").removeAttr("disabled");
$('#loadingPage').hide();
$('#pageData').show();
$('#pageBtnsWrapper').show();
// MAAKICHUT = response; // MAAKICHUT = response;
var files = data.files; var files = data.files;
// console.log(files); // console.log(files);

View File

@ -26,14 +26,17 @@
</div> </div>
<div id="pageDataWrapper"> <div id="pageDataWrapper">
<div id="loadingPage">Loading...</div>
<div id="pageData"> <div id="pageData">
Results: <span id="noOfResults"></span>. Page <span id="currentPageNo"></span> of <span id="noOfPages"></span> Results: <span id="noOfResults"></span>. Page <span id="currentPageNo"></span> of <span id="noOfPages"></span>
</div> </div>
<div id="pageBtnsWrapper">
<div id="firstPage">First</div> <div id="firstPage">First</div>
<div id="prevBtn">&lt;&lt;</div> <div id="prevBtn">&lt;&lt;</div>
<div id="nextBtn">&gt;&gt;</div> <div id="nextBtn">&gt;&gt;</div>
<div id="lastPage">Last</div> <div id="lastPage">Last</div>
</div> </div>
</div>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<div id="withSelected"> <div id="withSelected">