mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-09 12:21:57 -04:00
Preserve query string between snapshot list views
This commit is contained in:
parent
254d2502fd
commit
7db6b0a8a6
1 changed files with 21 additions and 2 deletions
|
@ -108,8 +108,8 @@
|
|||
{% endif %}
|
||||
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
|
||||
|
|
||||
<a href="{% url 'admin:core_snapshot_changelist' %}">☰</a>
|
||||
<a href="{% url 'admin:grid' %}"><span style="letter-spacing: -.4em">⣿⣿</span> </a>
|
||||
<a> <span id="snapshotListView" style="cursor: pointer">☰</span> </a>
|
||||
<a> <span id="snapshotGridView"style="letter-spacing: -.4em; cursor: pointer;">⣿⣿</span></a>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -182,8 +182,27 @@
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
function redirectWithQuery(uri){
|
||||
uri_query = uri + document.location.search;
|
||||
window.location = uri_query;
|
||||
|
||||
};
|
||||
|
||||
function bindSnapshotViewsClick() {
|
||||
$( document ).ready(function() {
|
||||
$("#snapshotListView").click(function() {
|
||||
redirectWithQuery("{% url 'admin:core_snapshot_changelist' %}");
|
||||
});
|
||||
$("#snapshotGridView").click(function() {
|
||||
redirectWithQuery("{% url 'admin:grid' %}");
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
$(function () {
|
||||
fix_actions();
|
||||
bindSnapshotViewsClick();
|
||||
});
|
||||
})(django.jQuery);
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue