Fix scroll position for esc out of edit."
parent
f8641c17c3
commit
17656e464b
|
@ -270,9 +270,13 @@
|
|||
if ($('section#main-edit:visible').length) {
|
||||
$('section#main-edit').hide();
|
||||
$('section#main').show();
|
||||
if (SniptList.$snipts.index($selected) === 0) {
|
||||
window.scrollTo(0, 0);
|
||||
} else {
|
||||
$('html, body').animate({
|
||||
scrollTop: $selected.offset().top - 50
|
||||
}, 0);
|
||||
}
|
||||
} else {
|
||||
if ($selected) {
|
||||
$selected.trigger('deselect');
|
||||
|
|
|
@ -75,14 +75,17 @@ def detail(request, username, snipt_slug):
|
|||
|
||||
if user == request.user:
|
||||
tags = tags.filter(snipt__user=user)
|
||||
public = False
|
||||
else:
|
||||
tags = tags.filter(snipt__user=user, snipt__public=True)
|
||||
public = True
|
||||
|
||||
tags = tags.annotate(count=Count('taggit_taggeditem_items__id'))
|
||||
tags = tags.order_by('-count', 'name')
|
||||
|
||||
return {
|
||||
'public': public,
|
||||
'snipt': snipt,
|
||||
'user': user,
|
||||
'tags': tags,
|
||||
'user': user,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue