mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 14:44:29 -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 %}
|
{% endif %}
|
||||||
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
|
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
|
||||||
|
|
|
|
||||||
<a href="{% url 'admin:core_snapshot_changelist' %}">☰</a>
|
<a> <span id="snapshotListView" style="cursor: pointer">☰</span> </a>
|
||||||
<a href="{% url 'admin:grid' %}"><span style="letter-spacing: -.4em">⣿⣿</span> </a>
|
<a> <span id="snapshotGridView"style="letter-spacing: -.4em; cursor: pointer;">⣿⣿</span></a>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% 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 () {
|
$(function () {
|
||||||
fix_actions();
|
fix_actions();
|
||||||
|
bindSnapshotViewsClick();
|
||||||
});
|
});
|
||||||
})(django.jQuery);
|
})(django.jQuery);
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue