From 23232d4f0e866c9c0a4aec9e1ca2dcda28df14be Mon Sep 17 00:00:00 2001 From: posativ Date: Sat, 27 Oct 2012 22:11:40 +0200 Subject: [PATCH] fix admin.js --- isso/templates/admin.js | 29 ++++------------------------- isso/templates/base.mako | 2 +- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/isso/templates/admin.js b/isso/templates/admin.js index 43cc300..6e9987c 100644 --- a/isso/templates/admin.js +++ b/isso/templates/admin.js @@ -1,26 +1,4 @@ -function remove(path, id, func) { - $.ajax({ - url: '/1.0/' + encodeURIComponent(path) + '/' + id, - method: 'DELETE', - type: 'json', - error: function(resp) { - alert('Mööp.'); - }, - success: function(resp) { - func(); - }, - }); -}; - - -// function approve(path, id, func) { -// $.ajax({ -// url: '' -// }) -// } - - function initialize() { $('article > footer > a').forEach(function(item) { @@ -35,9 +13,10 @@ function initialize() { }); } else { $(item).on('click', function(event) { - if (confirm("RLY?") == true) { - remove(path, id, function() { - $(node).remove() + if (confirm("RLY?") == true) { + $.ajax('DELETE', '/1.0/' + encodeURIComponent(path) + '/' + id).then( + function() { + $(node).remove() }); }; event.stop(); diff --git a/isso/templates/base.mako b/isso/templates/base.mako index e865776..938212c 100644 --- a/isso/templates/base.mako +++ b/isso/templates/base.mako @@ -2,7 +2,7 @@ <%block name="title" /> - +