diff options
author | Max Kostikov <max@kostikov.co> | 2019-12-04 10:07:09 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-12-04 10:07:09 +0100 |
commit | dad7bc82c3f4d826b3cc2b6fbeff588db44325c5 (patch) | |
tree | 7654c3035af943dffab7e2b9147dfde7a45a4c77 | |
parent | b48a9d3f7511bcb7a1b5d5dcec06f170b0f6ac9d (diff) | |
parent | 0ee65ee9543ab50b06953ac9ec282228bc825359 (diff) | |
download | volse-hubzilla-dad7bc82c3f4d826b3cc2b6fbeff588db44325c5.tar.gz volse-hubzilla-dad7bc82c3f4d826b3cc2b6fbeff588db44325c5.tar.bz2 volse-hubzilla-dad7bc82c3f4d826b3cc2b6fbeff588db44325c5.zip |
Merge branch 'dev' into 'dev'
Ad unpin button for pinned content and fix unpin on unpinned item drop
See merge request hubzilla/core!1795
-rw-r--r-- | Zotlabs/Widget/Pinned.php | 1 | ||||
-rw-r--r-- | view/js/main.js | 3 | ||||
-rwxr-xr-x | view/tpl/conv_item.tpl | 2 | ||||
-rw-r--r-- | view/tpl/pinned_item.tpl | 2 |
4 files changed, 5 insertions, 3 deletions
diff --git a/Zotlabs/Widget/Pinned.php b/Zotlabs/Widget/Pinned.php index 0ef724102..ec2c7f4e8 100644 --- a/Zotlabs/Widget/Pinned.php +++ b/Zotlabs/Widget/Pinned.php @@ -154,6 +154,7 @@ class Pinned { 'embed' => $embed, 'plink' => get_plink($item), 'pinned' => t('Pinned post'), + 'pinme' => t('Unpin from the top'), 'hide' => (! $is_new && $observer && ($observer['xchan_hash'] != $owner['xchan_hash']) ? t("Don't show") : ''), // end toolbar buttons 'modal_dismiss' => t('Close'), diff --git a/view/js/main.js b/view/js/main.js index 618436b2a..f8fe51ae6 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1160,7 +1160,8 @@ function dropItem(url, object) { $('body').css('cursor', 'auto'); }); }); - $.post('pin/pin', { 'id' : id }); + if($('#wall-item-pinned-') + id).length) + $.post('pin/pin', { 'id' : id }); return true; } else { diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 484554971..dcc06d5c4 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -172,7 +172,7 @@ <a class="dropdown-item" href="#" onclick="itemFiler({{$item.id}}); return false;"><i id="filer-{{$item.id}}" class="generic-icons-nav fa fa-fw fa-folder-open" title="{{$item.filer}}"></i>{{$item.filer}}</a> {{/if}} {{if $item.pinnable}} - <a class="dropdown-item dropdown-item-pinnable" href="#" onclick="dopin({{$item.id}}); return false;" title="{{$item.pinme}}" id="item-pinnable-{{$item.id}}"><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({{$item.id}}); return false;" id="item-pinnable-{{$item.id}}"><i class="generic-icons-nav fa fa-fw fa-thumb-tack"></i>{{$item.pinme}}</a> {{/if}} {{if $item.bookmark}} <a class="dropdown-item" href="#" onclick="itemBookmark({{$item.id}}); return false;"><i id="bookmarker-{{$item.id}}" class="generic-icons-nav fa fa-fw fa-bookmark" title="{{$item.bookmark}}"></i>{{$item.bookmark}}</a> diff --git a/view/tpl/pinned_item.tpl b/view/tpl/pinned_item.tpl index 0dad276d0..bfbdc87ff 100644 --- a/view/tpl/pinned_item.tpl +++ b/view/tpl/pinned_item.tpl @@ -137,10 +137,10 @@ {{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> {{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}} - </div> </div> </div> |