diff options
author | Max Kostikov <max@kostikov.co> | 2019-12-04 11:16:36 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-12-04 11:16:36 +0100 |
commit | d439dee7367e2decd73fafa81fab5d670bc1efe6 (patch) | |
tree | 728f7fdd0b338b0ed6e22ceb9d48a7e3b9c4b1aa | |
parent | 295c08fcf31e44ed48284768e6df92aaa11ab964 (diff) | |
parent | efa11cbc74d399131aeaa1a7039c2fa76baaca38 (diff) | |
download | volse-hubzilla-d439dee7367e2decd73fafa81fab5d670bc1efe6.tar.gz volse-hubzilla-d439dee7367e2decd73fafa81fab5d670bc1efe6.tar.bz2 volse-hubzilla-d439dee7367e2decd73fafa81fab5d670bc1efe6.zip |
Merge branch 'dev' into 'dev'
Fix switching pinned items
See merge request hubzilla/core!1796
-rw-r--r-- | view/js/main.js | 12 | ||||
-rw-r--r-- | view/tpl/pinned_item.tpl | 6 |
2 files changed, 9 insertions, 9 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"> </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"> </i></span>') me.html(me.html().replace(aStr['pin_item'],aStr['unpin_item'])); }; }) diff --git a/view/tpl/pinned_item.tpl b/view/tpl/pinned_item.tpl index bfbdc87ff..17e82b410 100644 --- a/view/tpl/pinned_item.tpl +++ b/view/tpl/pinned_item.tpl @@ -9,7 +9,7 @@ } </script> {{/if}} -<div id="pinned-wrapper-{{$id}}" class="thread-wrapper toplevel_item generic-content-wrapper h-entry" data-b64mids='{{$mids}}'> +<div id="pinned-wrapper-{{$id}}" class="pinned-item thread-wrapper toplevel_item generic-content-wrapper h-entry" data-b64mids='{{$mids}}'> <div class="wall-item-outside-wrapper" id="pinned-item-outside-wrapper-{{$id}}"> <div class="clearfix wall-item-content-wrapper" id="pinned-item-content-wrapper-{{$id}}"> {{if $photo}} @@ -41,7 +41,7 @@ {{/if}} {{/if}} <div class="p-2 clearfix wall-item-head{{if !$title && !$event && !$photo}} rounded-top{{/if}}{{if $is_new && !$event}} wall-item-head-new{{/if}}"> - <span class="float-right wall-item-pinned" title="{{$pinned}}"><i class="fa fa-thumb-tack"> </i></span> + <span class="float-right" title="{{$pinned}}"><i class="fa fa-thumb-tack"> </i></span> <div class="wall-item-info" id="pinned-item-info-{{$id}}" > <div class="wall-item-photo-wrapper{{if $owner_url}} wwfrom{{/if}} h-card p-author" id="pinned-item-photo-wrapper-{{$id}}"> <img src="{{$thumb}}" class="fakelink wall-item-photo u-photo p-name" id="pinned-item-photo-{{$id}}" alt="{{$name}}" data-toggle="dropdown" /> @@ -137,7 +137,7 @@ {{if $plink}} <a class="dropdown-item" href="{{$plink.href}}" title="{{$plink.title}}" class="u-url"><i class="generic-icons-nav fa fa-fw fa-external-link"></i>{{$plink.title}}</a> {{/if}} - <a class="dropdown-item dropdown-item-pinnable" href="#" onclick="dopin({{$item.id}}); return false;"><i class="generic-icons-nav fa fa-fw fa-thumb-tack"></i>{{$item.pinme}}</a> + <a class="dropdown-item dropdown-item-pinnable" href="#" onclick="dopin({{$id}}); return false;"><i class="generic-icons-nav fa fa-fw fa-thumb-tack"></i>{{$pinme}}</a> {{if $hide}} <a class="dropdown-item" href="#" onclick="dopinhide({{$id}}); return false;" class="u-url"><i class="generic-icons-nav fa fa-fw fa-remove"></i>{{$hide}}</a> {{/if}} |