Added a way to closed the extended chat window

This commit is contained in:
Grant Woodford 2013-11-28 21:48:08 +02:00
parent a120d78b7e
commit 383a216a7d
2 changed files with 16 additions and 4 deletions

View file

@ -41,15 +41,15 @@ var chat = (function()
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#titlesticky').hide();
$('#editorcontainer').css({"right":"192px"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#titlesticky').show();
$('#editorcontainer').css({"right":"0px"});
isStuck = false;
isStuck = false;
}
},
hide: function ()

View file

@ -390,7 +390,7 @@
<div id="chatbox">
<div id="titlebar"><span id ="titlelabel" data-l10n-id="pad.chat"></span>
<a id="titlecross" onClick="chat.hide();return false;">-&nbsp;</a>
<a id="titlecross" onClick="minimizeChatbox();">-&nbsp;</a>
<a id="titlesticky" onClick="chat.stickToScreen(true);$('#options-stickychat').prop('checked', true);return false;" title="Stick chat to screen">&nbsp;&nbsp;</a>
</div>
<div id="chattext" class="authorColors">
@ -476,6 +476,18 @@
padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar;
padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp;
}());
function minimizeChatbox()
{
if ($('#options-stickychat').prop('checked')) {
chat.stickToScreen();
$('#options-stickychat').prop('checked', false);
} else {
chat.hide();
}
return false;
}
</script>
<% e.end_block(); %>
</html>