add link to parent of comment
This commit is contained in:
parent
eb50618fe8
commit
268d441c48
3 changed files with 18 additions and 2 deletions
|
|
@ -184,6 +184,7 @@ $(document).ready(function () {
|
|||
if (typeof searchValue !== "undefined") {
|
||||
$("#nav-search-input-field").val(searchValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// move the "Save the search" button to the second navbar
|
||||
|
|
@ -941,4 +942,13 @@ function toggleDropdownText(elm) {
|
|||
function hasClass(elem, cls) {
|
||||
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
|
||||
|
|
|
|||
|
|
@ -214,6 +214,10 @@ as the value of $top_child_total (this is done at the end of this file)
|
|||
<span class="text-muted">
|
||||
</h5>
|
||||
<small>
|
||||
{{if !$item.parentguid==""}}
|
||||
<a id="btn-{{$item.id}}" class="time" href="javascript:;" onclick="goToParentItem('{{$item.plink.orig}}', '{{$item.parentguid}}');">{{$item.isanswerto}}</a>
|
||||
•
|
||||
{{/if}}
|
||||
<a href="{{$item.plink.orig}}">
|
||||
<time class="time" title="{{$item.localtime}}" data-toggle="tooltip" datetime="{{$item.utc}}">{{$item.ago}}</time>
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue