diff options
-rw-r--r-- | view/js/main.js | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/view/js/main.js b/view/js/main.js index 94f290fae..24840ca98 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1124,21 +1124,20 @@ function doscrollback(pos) { function dopin(id) { id = id.toString(); $('#like-rotator-' + id).show(); - $.post('pin', { 'id' : id } ) + $.post('pin', { 'id' : id }) .done(function() { var i = $('#wall-item-pinned-' + id); var me = $('#item-pinnable-' + id); if($('#pinned-wrapper-' + id).length) { $('html, body').animate({ scrollTop: $('#region_2').offset().top }, 'slow', function() { - $('#pinned-wrapper-' + id).fadeOut(function() { this.remove(); - }); + $('#pinned-wrapper-' + id).fadeTo('fast', 0.33, function() { this.remove(); }); }); }; $('.wall-item-pinned').remove(); if(i.length) me.html(me.html().replace(aStr['unpin_item'],aStr['pin_item'])); else { - $('<span class="float-right wall-item-pinned" title="' + aStr['pinned'] + '" id="wall-item-pinned-' + id + '"><i class="fa fa-thumb-tack"> </i></span>') + $('<span class="float-right wall-item-pinned" title="' + aStr['pinned'] + '" id="wall-item-pinned-' + id + '"><i class="fa fa-thumb-tack"> </i></span>').insertBefore('#wall-item-info-' + id); me.html(me.html().replace(aStr['pin_item'],aStr['unpin_item'])); }; }) @@ -1150,22 +1149,24 @@ function dopin(id) { }); } -function dropItem(url, object) { +function dropItem(url, object) { - var confirm = confirmDelete(); - if(confirm) { - $('body').css('cursor', 'wait'); - $(object).fadeTo('fast', 0.33, function () { - $.get(url).done(function() { - $(object).remove(); - $('body').css('cursor', 'auto'); - }); - }); - return true; - } - else { - return false; - } + var confirm = confirmDelete(); + if(confirm) { + var id = url.split('/')[2]; + $('body').css('cursor', 'wait'); + $(object + ', #pinned-wrapper-' + id).fadeTo('fast', 0.33, function () { + $.post('pin', { 'id' : id }); + $.get(url).done(function() { + $(object + ', #pinned-wrapper-' + id).remove(); + $('body').css('cursor', 'auto'); + }); + }); + return true; + } + else { + return false; + } } function dosubthread(ident) { |