forked from rDrama/rDrama
make the page always jump to the comment you wanna view
parent
b2ef1f0fce
commit
f9a0cff350
|
@ -67,8 +67,8 @@ def pusher_thread(interests, c, username):
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
||||||
|
|
||||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}#context")
|
||||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','') + '#context')
|
||||||
|
|
||||||
try: cid = int(cid)
|
try: cid = int(cid)
|
||||||
except: abort(404)
|
except: abort(404)
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{%- from 'util/assetcache.html' import asset -%}
|
{%- from 'util/assetcache.html' import asset -%}
|
||||||
{%- import 'util/helpers.html' as help -%}
|
{%- import 'util/helpers.html' as help -%}
|
||||||
{% if not ajax %}
|
{% if not ajax %}
|
||||||
{% if comment_info and not request.full_path.endswith('#context') %}
|
{% if comment_info %}
|
||||||
<script>
|
<script>
|
||||||
history.pushState(null, null, '#context');
|
if (location.hash != 'context')
|
||||||
|
location.hash = 'context'
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue