egeste/ttTools — Issue #49: Become DJ if < MaxDjs Should DIsable the Button
Author: cgountanis
Created: 2011-12-09 16:08:42+00:00
State: open

$('#autoDJ').click(function (e) {
var room = ttTools.getRoom();
if (!room) { return false; }
ttTools.autoDJ = !ttTools.autoDJ;
if(ttTools.autoDJ && !room.isDj() && room.djIds.length < room.maxDjs) {
room.becomeDj(); //added
ttTools.autoDJ = false; //added
$('#autoDJ').prop('checked', false).button('refresh');
}
}).prop('checked', ttTools.autoDJ).button('refresh');