make undo repeat work. There are still a couple of quirks to deal with but it appears to work.

This commit is contained in:
Mike Macgirvin 2024-04-20 19:42:37 +10:00
parent 5004a80f3d
commit 3449823d92
2 changed files with 8 additions and 2 deletions

View file

@ -229,6 +229,7 @@ class ThreadItem
$my_responses[$v] = ((isset($conv_responses[$v][$item['mid'] . '-m']) && $conv_responses[$v][$item['mid'] . '-m']) ? 1 : 0);
if ($v === 'repeat') {
$undo_repeat = $conv_responses[$v][$item['mid'] . '-mitem'];
}
}
$like_count = ((x($conv_responses['like'], $item['mid'])) ? $conv_responses['like'][$item['mid']] : '');
@ -343,7 +344,12 @@ class ThreadItem
}
if ($shareable) {
$share = t('Repeat this');
if ($my_responses['repeat']) {
$share = t('Undo repeat');
}
else {
$share = t('Repeat this');
}
}
$dreport = '';

View file

@ -161,7 +161,7 @@
<a class="dropdown-item" href="#" onclick="jotEmbed({{$item.id}},{{$item.item_type}}); return false"><i class="generic-icons-nav fa fa-fw fa-share" title="{{$item.embed}}"></i>{{$item.embed}}</a>
{{/if}}
{{if $item.share}}
<a class="dropdown-item" href="#" onclick="jotShare({{$item.id}},{{$item.item_type}}); return false"><i class="generic-icons-nav fa fa-fw fa-bullhorn" title="{{$item.share}}"></i>{{$item.share}}</a>
<a class="dropdown-item" href="#" {{if $item.undo_repeat}}onclick="dropItem('item/drop/{{$item.undo_repeat}}', '#thread-wrapper-{{$item.id}}'); return false;"{{else}}onclick="jotShare({{$item.id}},{{$item.item_type}}); return false"{{/if}}><i class="generic-icons-nav fa fa-fw fa-bullhorn" title="{{$item.share}}"></i>{{$item.share}}</a>
{{/if}}
{{if $item.plink}}
<a class="dropdown-item" href="{{$item.plink.href}}" target="_blank" title="{{$item.plink.title}}" class="u-url"><i class="generic-icons-nav fa fa-fw fa-external-link"></i>{{$item.plink.title}}</a>