mirror of https://github.com/calzoneman/sync.git
Prevent chat from autoscrolling when mouse inside
This commit is contained in:
parent
31fd011b4d
commit
7b11651e1e
|
@ -103,7 +103,8 @@ function initCallbacks() {
|
||||||
if($("#messagebuffer").children().length > 100) {
|
if($("#messagebuffer").children().length > 100) {
|
||||||
$($("#messagebufer").children()[0]).remove();
|
$($("#messagebufer").children()[0]).remove();
|
||||||
}
|
}
|
||||||
$("#messagebuffer").scrollTop($("#messagebuffer").prop("scrollHeight"));
|
if(SCROLLCHAT)
|
||||||
|
$("#messagebuffer").scrollTop($("#messagebuffer").prop("scrollHeight"));
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("playlist", function(data) {
|
socket.on("playlist", function(data) {
|
||||||
|
@ -298,6 +299,9 @@ function initCallbacks() {
|
||||||
|
|
||||||
socket.on("newPoll", function(data) {
|
socket.on("newPoll", function(data) {
|
||||||
addPoll(data);
|
addPoll(data);
|
||||||
|
if(SCROLLCHAT) {
|
||||||
|
$("#messagebuffer").scrollTop($("#messagebuffer").prop("scrollHeight"));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("updatePoll", function(data) {
|
socket.on("updatePoll", function(data) {
|
||||||
|
|
|
@ -22,6 +22,7 @@ var OLDINDEX = -1;
|
||||||
var CHATHIST = [];
|
var CHATHIST = [];
|
||||||
var CHATHISTIDX = 0;
|
var CHATHISTIDX = 0;
|
||||||
var FOCUSED = true;
|
var FOCUSED = true;
|
||||||
|
var SCROLLCHAT = true;
|
||||||
var PAGETITLE = "Sync";
|
var PAGETITLE = "Sync";
|
||||||
var TITLE_BLINK;
|
var TITLE_BLINK;
|
||||||
var uname = readCookie("sync_uname");
|
var uname = readCookie("sync_uname");
|
||||||
|
@ -254,6 +255,9 @@ $("#chatline").keydown(function(ev) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#messagebuffer").mouseenter(function() { SCROLLCHAT = false; });
|
||||||
|
$("#messagebuffer").mouseleave(function() { SCROLLCHAT = true; });
|
||||||
|
|
||||||
$("#opt_submit").click(function() {
|
$("#opt_submit").click(function() {
|
||||||
var ptitle = $("#opt_pagetitle").val();
|
var ptitle = $("#opt_pagetitle").val();
|
||||||
if(ptitle == "")
|
if(ptitle == "")
|
||||||
|
|
Loading…
Reference in New Issue