X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6fe9513613b3d0dcfc934c41a5bfa9b71f341b06..3199cbfa76c763b4082b5a8d8f971d74f67e27c0:/media/js/catalogue.js diff --git a/media/js/catalogue.js b/media/js/catalogue.js index d403a702b..ad5a7c2c8 100644 --- a/media/js/catalogue.js +++ b/media/js/catalogue.js @@ -101,6 +101,8 @@ hash.w.show(); }, onLoad: function(hash) { + var shelf_name = $('a.visit-shelf', this).html(); + $('form', hash.w).ajaxForm({ target: $('#user-shelves-window div.target'), success: function() { setTimeout(function() { $('#user-shelves-window').jqmHide() }, 1000) } @@ -115,10 +117,12 @@ }); $('.delete-shelf').click(function() { - $.post($(this).attr('href'), function(data, textStatus) { - $('#user-shelves-window div.target').html(data); - setTimeout(function() { $('#user-shelves-window').jqmHide() }, 1000); - }); + if (confirm('Czy na pewno usunąć półkę ' + shelf_name + '?')) { + $.post($(this).attr('href'), function(data, textStatus) { + $('#user-shelves-window div.target').html(data); + setTimeout(function() { $('#user-shelves-window').jqmHide() }, 1000); + }); + } return false; }); }