From fb67606ba70b1c8ffb307f12de255db0431950a5 Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 29 Jun 2011 22:44:27 +0530 Subject: [PATCH] works on local, testing --- edgware/static/js/files/browse.js | 12 +++++++++--- edgware/templates/files/browser.html | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/edgware/static/js/files/browse.js b/edgware/static/js/files/browse.js index a9936ca..85332c4 100644 --- a/edgware/static/js/files/browse.js +++ b/edgware/static/js/files/browse.js @@ -2,7 +2,10 @@ $(function() { $('#filterForm').submit(function(e) { e.preventDefault(); var formData = $(this).serializeArray(); + $('#submitFilter').val("Loading...").attr("disabled", "disabled"); $.post("files/json_list", formData, function(response) { + $('#submitFilter').val("Submit").removeAttr("disabled"); +// MAAKICHUT = response; var data = JSON.parse(response); var files = data.files; // console.log(files); @@ -19,13 +22,16 @@ $(function() { function getJQ(f) { var jq = $("
").data("data", f).addClass("fileItem").text(f.type + ": " + f.title); jq.click(function() { - var d = $(this).data("data"); + var $this = $(this); + $('.selectedItem').removeClass("selectedItem"); + $this.addClass("selectedItem"); + var d = $this.data("data"); switch (d.type) { case "image": - var html = ""; + var html = ""; break; default: - var html = "Click to view"; + var html = "Click to view"; } $('#previewPane').html(html); }); diff --git a/edgware/templates/files/browser.html b/edgware/templates/files/browser.html index a39600d..7f867f0 100644 --- a/edgware/templates/files/browser.html +++ b/edgware/templates/files/browser.html @@ -11,7 +11,7 @@
{{ filterForm.as_p }}

- +