hide_chat setting is remembered and used by session cookie
This commit is contained in:
parent
708513039a
commit
df1bd15e49
|
@ -27,10 +27,10 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li id="toggleChat"><a onclick="toggle_chat()" href="javascript:void(0);">→</a></li>
|
<li id="toggleChat"><a onclick="toggle_chat()" href="javascript:void(0);">{% if request.session.get("hide_chat") == True %}←{% else %}→{% endif %}</a></li>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="questPane">
|
<div id="questPane" style="width:{% if request.session.get("hide_chat") == True %}100%{% else %}70%{% endif %};">
|
||||||
<center><h1>{{ quest.title }}</h1></center>
|
<center><h1>{{ quest.title }}</h1></center>
|
||||||
<div id="questPosts">
|
<div id="questPosts">
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
|
@ -141,7 +141,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div id="chatPane" style="display:flex;">
|
<div id="chatPane" style="display:{% if request.session.get("hide_chat") == True %}none{% else %}flex{% endif %};">
|
||||||
<h1>Chat</h1>
|
<h1>Chat</h1>
|
||||||
<div id="chatWindow">
|
<div id="chatWindow">
|
||||||
{% autoescape false %}
|
{% autoescape false %}
|
||||||
|
|
|
@ -251,11 +251,13 @@ function toggle_chat() {
|
||||||
if (document.getElementById('chatPane').style.display == 'flex') {
|
if (document.getElementById('chatPane').style.display == 'flex') {
|
||||||
document.getElementById('chatPane').style.display = 'none';
|
document.getElementById('chatPane').style.display = 'none';
|
||||||
document.getElementById('questPane').style.width = '100%';
|
document.getElementById('questPane').style.width = '100%';
|
||||||
|
document.getElementById('toggleChat').firstChild.innerText = '←';
|
||||||
toggle_cookie('hide_chat', 'on');
|
toggle_cookie('hide_chat', 'on');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
document.getElementById('chatPane').style.display = 'flex';
|
document.getElementById('chatPane').style.display = 'flex';
|
||||||
document.getElementById('questPane').style.width = '70%';
|
document.getElementById('questPane').style.width = '70%';
|
||||||
|
document.getElementById('toggleChat').firstChild.innerText = '→';
|
||||||
toggle_cookie('hide_chat', 'off');
|
toggle_cookie('hide_chat', 'off');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user