make chat code remember and restore the last chat tab used on reload
This commit is contained in:
parent
fb30e2530d
commit
2f40571ee1
@ -489,6 +489,8 @@ window.chat.needMoreMessages = function() {
|
|||||||
window.chat.chooseAnchor = function(t) {
|
window.chat.chooseAnchor = function(t) {
|
||||||
var tt = t.text();
|
var tt = t.text();
|
||||||
|
|
||||||
|
localStorage['iitc-chat-tab'] = tt;
|
||||||
|
|
||||||
var mark = $('#chatinput mark');
|
var mark = $('#chatinput mark');
|
||||||
var input = $('#chatinput input');
|
var input = $('#chatinput input');
|
||||||
|
|
||||||
@ -578,6 +580,11 @@ window.chat.keepScrollPosition = function(box, scrollBefore, isOldMsgs) {
|
|||||||
window.chat.setup = function() {
|
window.chat.setup = function() {
|
||||||
window.chat._localRangeCircle = L.circle(map.getCenter(), CHAT_MIN_RANGE*1000);
|
window.chat._localRangeCircle = L.circle(map.getCenter(), CHAT_MIN_RANGE*1000);
|
||||||
|
|
||||||
|
if (localStorage['iitc-chat-tab']) {
|
||||||
|
var t = $('<a>'+localStorage['iitc-chat-tab']+'</a>');
|
||||||
|
window.chat.chooseAnchor(t);
|
||||||
|
}
|
||||||
|
|
||||||
$('#chatcontrols, #chat, #chatinput').show();
|
$('#chatcontrols, #chat, #chatinput').show();
|
||||||
|
|
||||||
$('#chatcontrols a:first').click(window.chat.toggle);
|
$('#chatcontrols a:first').click(window.chat.toggle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user