Made buttons be greyed out when they're selected
This commit is contained in:
parent
bc797a9e12
commit
33c3d5f30a
|
@ -142,6 +142,10 @@ function title(id) {
|
|||
|
||||
function profile_switch_to(id)
|
||||
{
|
||||
// Switch the profile classes
|
||||
$("#profile_button_"+active_profile).removeClass("selected");
|
||||
$("#profile_button_"+id).addClass("selected");
|
||||
|
||||
// Set the active profile
|
||||
active_profile = id;
|
||||
|
||||
|
@ -152,7 +156,7 @@ function profile_switch_to(id)
|
|||
for(var i=0;i<connections[id].chats.length;i++)
|
||||
{
|
||||
// Add to the chats menu
|
||||
chats_menu += "<li><a href='#' onclick=chat_switch_to("+i+")>"
|
||||
chats_menu += "<li><a href='#' onclick=chat_switch_to("+i+") id='chat_switch_"+i+"'>"
|
||||
+connections[id].chats[i].name+"</a></li>";
|
||||
}
|
||||
|
||||
|
@ -259,6 +263,10 @@ function chat_switch_to(id)
|
|||
document.title = title(active_profile)+" - "
|
||||
+connections[active_profile].chats[id].name;
|
||||
|
||||
// Move the active class
|
||||
$("#chat_switch_"+active_chat).removeClass("selected");
|
||||
$("#chat_switch_"+id).addClass("selected");
|
||||
|
||||
// Set the active chat
|
||||
active_chat = id;
|
||||
|
||||
|
@ -335,6 +343,9 @@ function chat_send()
|
|||
|
||||
function add_chat_menu()
|
||||
{
|
||||
// Deselect the selected chat
|
||||
$("#chat_switch_"+active_chat).removeClass("selected");
|
||||
|
||||
// Set the html data
|
||||
document.getElementById("chat-area").innerHTML = "\
|
||||
<p>\
|
||||
|
@ -361,6 +372,8 @@ function add_chat()
|
|||
|
||||
function profiles_reload()
|
||||
{
|
||||
console.log("Profiles reloaded");
|
||||
|
||||
// Get the chat menu id
|
||||
var chat_menu = document.getElementById("server-menu-profiles");
|
||||
|
||||
|
|
Loading…
Reference in New Issue