clearing local storage on logout
This commit is contained in:
1
rowers/templates/.#menuscript.html
Normal file
1
rowers/templates/.#menuscript.html
Normal file
@@ -0,0 +1 @@
|
||||
E408191@CZ27LT9RCGN72.14924:1540272798
|
||||
@@ -8,7 +8,9 @@
|
||||
function(i, obj) {
|
||||
var theid = $(this).attr('id');
|
||||
var state = localStorage.getItem(theid);
|
||||
if (state !== null) {
|
||||
$(this).find('input:first').prop("checked",state);
|
||||
};
|
||||
});
|
||||
});
|
||||
$(function() {
|
||||
|
||||
@@ -41,3 +41,5 @@
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="{% url 'logout' %}?next=/login" title="Sign Out">
|
||||
<a class="" href="{% url 'logout' %}?next=/login" title="Sign Out" id="id-logout">
|
||||
<i class="fas fa-sign-out-alt "></i>
|
||||
</a>
|
||||
</li>
|
||||
@@ -380,3 +380,16 @@
|
||||
{% block body_bottom %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script
|
||||
type='text/javascript'
|
||||
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
||||
</script>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#id-logout").click( function() {
|
||||
localStorage.clear();
|
||||
console.log('cleared storage');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user