aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-12-04 11:11:39 +0100
committerMax Kostikov <max@kostikov.co>2019-12-04 11:11:39 +0100
commit4a8e222763244ee919261f26bb30a4e1e12aa1cf (patch)
tree821751fd84a75d247b0c433a5eeec042053ba64d /view
parent75b9c7d6b8c8d9c9ad2faf837a0ced975c536488 (diff)
downloadvolse-hubzilla-4a8e222763244ee919261f26bb30a4e1e12aa1cf.tar.gz
volse-hubzilla-4a8e222763244ee919261f26bb30a4e1e12aa1cf.tar.bz2
volse-hubzilla-4a8e222763244ee919261f26bb30a4e1e12aa1cf.zip
Fix update pin / unpin button text on pinned item replace
Diffstat (limited to 'view')
-rw-r--r--view/js/main.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 78ed8a6c9..f45a06b24 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -1128,15 +1128,15 @@ function dopin(id) {
.done(function() {
var i = $('#wall-item-pinned-' + id);
var me = $('#item-pinnable-' + id);
- if($('#pinned-wrapper-' + id).length) {
+ if($('.pinned-item').length) {
$('html, body').animate({ scrollTop: $('#region_2').offset().top }, 'slow', function() {
- $('#pinned-wrapper-' + id).fadeTo('fast', 0.33, function() { this.remove(); });
+ $('.pinned-item').fadeTo('fast', 0.33, function() { this.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">&nbsp;</i></span>').insertBefore('#wall-item-info-' + id);
+ $('.wall-item-pinned').remove();
+ $('.dropdown-item-pinnable').html($('.dropdown-item-pinnable').html().replace(aStr['unpin_item'],aStr['pin_item']));
+ if(i.length == 0) {
+ $('<span class="float-right wall-item-pinned" title="' + aStr['pinned'] + '" id="wall-item-pinned-' + id + '"><i class="fa fa-thumb-tack">&nbsp;</i></span>')
me.html(me.html().replace(aStr['pin_item'],aStr['unpin_item']));
};
})