Changed to not use inline JavaScript

pull/2014/head
Grant Woodford 2013-12-15 12:02:43 +02:00
parent d1367484e3
commit 17666eaef7
2 changed files with 13 additions and 18 deletions

View File

@ -54,11 +54,18 @@ var chat = (function()
}, },
hide: function () hide: function ()
{ {
// decide on hide logic based on chat window being maximized or not
if ($('#options-stickychat').prop('checked')) {
chat.stickToScreen();
$('#options-stickychat').prop('checked', false);
}
else {
$("#chatcounter").text("0"); $("#chatcounter").text("0");
$("#chaticon").show(); $("#chaticon").show();
$("#chatbox").hide(); $("#chatbox").hide();
$.gritter.removeAll(); $.gritter.removeAll();
$("#gritter-notice-wrapper").show(); $("#gritter-notice-wrapper").show();
}
}, },
scrollDown: function() scrollDown: function()
{ {

View File

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