From 7b77f3d4b58b4a15d46116b0e712bba85f34656b Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 25 Jan 2012 19:03:25 +0000 Subject: [PATCH] Toggle sticky chatf unction can be called very easily, 0ip to add to settings interface --- static/js/chat.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/static/js/chat.js b/static/js/chat.js index 475d01939..5fd1ad854 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -24,6 +24,7 @@ var padutils = require('/pad_utils').padutils; var chat = (function() { + var isStuck = false; var bottomMargin = "0px"; var sDuration = 500; var hDuration = 750; @@ -68,6 +69,22 @@ var chat = (function() chatMentions = 0; document.title = title; }, + stickToScreen: function() // Make chat stick to right hand side of screen + { + console.log(isStuck); + chat.show(); + if(!isStuck){ // Stick it to + $('#chatbox').css({"right":"0px", "top":"35px", "border-radius":"0px", "height":"auto"}); + $('#editorcontainer').css({"right":"170px", "width":"auto"}); + isStuck = true; + } + else{ // Unstick it + $('#chatbox').css({"right":"0px", "top":"auto", "border-top-radius":"5px", "height":"200px"}); + $('#editorcontainer').css({"right":"0px", "width":"100%"}); + isStuck = false; + } + } + , hide: function () { $("#chatcounter").text("0");