aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-12-04 10:07:09 +0100
committerMax Kostikov <max@kostikov.co>2019-12-04 10:07:09 +0100
commitdad7bc82c3f4d826b3cc2b6fbeff588db44325c5 (patch)
tree7654c3035af943dffab7e2b9147dfde7a45a4c77
parentb48a9d3f7511bcb7a1b5d5dcec06f170b0f6ac9d (diff)
parent0ee65ee9543ab50b06953ac9ec282228bc825359 (diff)
downloadvolse-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.php1
-rw-r--r--view/js/main.js3
-rwxr-xr-xview/tpl/conv_item.tpl2
-rw-r--r--view/tpl/pinned_item.tpl2
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>