Compare commits

...

2 commits

Author SHA1 Message Date
Jakobus Schürz
a82127092b use scrollToItem instead of own function
rename isanswerto and "Is answer to" to isreplyto and "is reply to"
2023-10-05 17:19:16 +02:00
Jakobus Schürz
63df9ffe2f change logic in if clause in case of codereview 2023-10-05 17:02:33 +02:00
3 changed files with 3 additions and 13 deletions

View file

@ -498,7 +498,7 @@ class Post
$tmp_item = [ $tmp_item = [
'parentguid' => $parent_guid, 'parentguid' => $parent_guid,
'isanswerto' => DI::l10n()->t('is answer to %s', $parent_username), 'isreplyto' => DI::l10n()->t('is reply to %s', $parent_username),
'template' => $this->getTemplate(), 'template' => $this->getTemplate(),
'type' => implode('', array_slice(explode('/', $item['verb']), -1)), 'type' => implode('', array_slice(explode('/', $item['verb']), -1)),
'comment_firstcollapsed' => false, 'comment_firstcollapsed' => false,

View file

@ -184,7 +184,6 @@ $(document).ready(function () {
if (typeof searchValue !== "undefined") { if (typeof searchValue !== "undefined") {
$("#nav-search-input-field").val(searchValue); $("#nav-search-input-field").val(searchValue);
} }
} }
// move the "Save the search" button to the second navbar // move the "Save the search" button to the second navbar
@ -942,13 +941,4 @@ function toggleDropdownText(elm) {
function hasClass(elem, cls) { function hasClass(elem, cls) {
return (" " + elem.className + " ").indexOf(" " + cls + " ") > -1; return (" " + elem.className + " ").indexOf(" " + cls + " ") > -1;
} }
// Go to parent for "is answer to <user>" link in comments below username
function goToParentItem(plink, pguid) {
history.pushState({},"",plink);
var loc = plink.split("/");
loc.pop();
loc.push(pguid);
location.href = loc.join("/");
}
// @license-end // @license-end

View file

@ -59,8 +59,8 @@ as the value of $top_child_total (this is done at the end of this file)
<span class="uriid" style="display: none;">{{$item.uriid}}</span> <span class="uriid" style="display: none;">{{$item.uriid}}</span>
{{/if}} {{/if}}
<div class="media {{$item.shiny}}"> <div class="media {{$item.shiny}}">
{{if !$item.parentguid==""}} {{if $item.parentguid}}
<a id="btn-{{$item.id}}" class="time" href="javascript:;" onclick="goToParentItem('{{$item.plink.orig}}', '{{$item.parentguid}}');">{{$item.isanswerto}}</a> <a id="btn-{{$item.id}}" class="time" href="javascript:;" onclick="scrollToItem('item-' + '{{$item.parentguid}}');">{{$item.isreplyto}}</a>
{{if $item.reshared}}<span class="hidden-xs">&#x2022;</span>{{/if}} {{if $item.reshared}}<span class="hidden-xs">&#x2022;</span>{{/if}}
<br class="visible-xs"> <br class="visible-xs">
{{/if}} {{/if}}