diff options
author | Max Kostikov <max@kostikov.co> | 2019-12-01 16:30:16 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-12-01 16:30:16 +0100 |
commit | 20c296ce5398a61d6f664f0c0b47c9abdc9b2586 (patch) | |
tree | 3a73693c5ab81872fa876b4c79df417759a2c912 /view/js/main.js | |
parent | 5ccbcb44f7e4e2bbd3343ba48f417c98d0933f67 (diff) | |
download | volse-hubzilla-20c296ce5398a61d6f664f0c0b47c9abdc9b2586.tar.gz volse-hubzilla-20c296ce5398a61d6f664f0c0b47c9abdc9b2586.tar.bz2 volse-hubzilla-20c296ce5398a61d6f664f0c0b47c9abdc9b2586.zip |
Add scroll to pinned item before removal
Diffstat (limited to 'view/js/main.js')
-rw-r--r-- | view/js/main.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/view/js/main.js b/view/js/main.js index 9fe513694..94f290fae 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1128,7 +1128,12 @@ function dopin(id) { .done(function() { var i = $('#wall-item-pinned-' + id); var me = $('#item-pinnable-' + id); - $('#pinned-wrapper-' + id).fadeOut(function() { this.remove(); }); + if($('#pinned-wrapper-' + id).length) { + $('html, body').animate({ scrollTop: $('#region_2').offset().top }, 'slow', function() { + $('#pinned-wrapper-' + id).fadeOut(function() { this.remove(); + }); + }); + }; $('.wall-item-pinned').remove(); if(i.length) me.html(me.html().replace(aStr['unpin_item'],aStr['pin_item'])); |