From 7c471208da8a3271f0068842441d785dee67639b Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 3 Jan 2013 22:40:03 +0530 Subject: [PATCH] media gallery display - small bugs --- itf/templates/mediagallery/upload.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/itf/templates/mediagallery/upload.html b/itf/templates/mediagallery/upload.html index 95147f4..4c030e7 100644 --- a/itf/templates/mediagallery/upload.html +++ b/itf/templates/mediagallery/upload.html @@ -45,6 +45,7 @@ $(function() { return false; } var $this = $(e.target); + //console.log($this.closest('li')); var id = $this.closest('li').attr("data-id"); var url = "/mediagallery/delete_link/" + id; $.get(url, {}, function(response) { @@ -85,6 +86,7 @@ $(function() { $this.text("Adding..."); var url = "/mediagallery/add_youtube/" + GALLERY_ID; $.get(url, {'url': yt_url}, function(data) { + $('#youtubeURL').val(''); $this.removeAttr("disabled"); $this.text("Add"); var $ul = $('#youtubeVideos'); @@ -102,8 +104,8 @@ $(function() { $('#addLink').click(function(e) { e.preventDefault(); - var url = $.trim($('#linkURL').val()); - if (url === '') { + var linkURL = $.trim($('#linkURL').val()); + if (linkURL === '') { alert("please enter a link"); return; } @@ -111,7 +113,9 @@ $(function() { $this.attr("disabled", "disabled"); var title = prompt("Please enter a title for the link"); var url = "/mediagallery/add_link/" + GALLERY_ID; - $.get(url, {'url': url, 'title': title}, function(data) { + $.get(url, {'url': linkURL, 'title': title}, function(data) { + $('#linkURL').val(''); + console.log(data); $this.removeAttr("disabled"); var $ul = $('#links'); var $li = $('
  • ') @@ -208,7 +212,7 @@ $(function() {