summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-07-24 10:36:52 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-07-24 10:36:52 +0000
commit97430f7aed543c5c04d172ec385a7b0dc5574888 (patch)
treeef4c3ebd902356d082eea910127082c11ff34826 /roundcubemail/program/js
parent2c3be27b1186b2ee082ab42632a6707a2b230bce (diff)
Improve button capabilities
git-svn-id: https://svn.roundcube.net/trunk@2796 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js')
-rw-r--r--roundcubemail/program/js/app.js61
1 files changed, 36 insertions, 25 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index c8a8c5875..a0679264a 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/program/js/app.js
@@ -3461,67 +3461,78 @@ function rcube_webmail()
// mouse over button
this.button_over = function(command, id)
- {
+ {
var a_buttons = this.buttons[command];
- var button, img;
+ var button, elm;
if(!a_buttons || !a_buttons.length)
return false;
for(var n=0; n<a_buttons.length; n++)
- {
+ {
button = a_buttons[n];
if(button.id==id && button.status=='act')
- {
- img = document.getElementById(button.id);
- if (img && button.over)
- img.src = button.over;
+ {
+ elm = document.getElementById(button.id);
+ if (elm && button.over) {
+ if (button.type == 'image')
+ elm.src = button.over;
+ else
+ elm.className = button.over;
}
}
-
- };
+ }
+ };
// mouse down on button
this.button_sel = function(command, id)
- {
+ {
var a_buttons = this.buttons[command];
- var button, img;
+ var button, elm;
if(!a_buttons || !a_buttons.length)
return;
for(var n=0; n<a_buttons.length; n++)
- {
+ {
button = a_buttons[n];
if(button.id==id && button.status=='act')
- {
- img = document.getElementById(button.id);
- if (img && button.sel)
- img.src = button.sel;
+ {
+ elm = document.getElementById(button.id);
+ if (elm && button.sel) {
+ if (button.type == 'image')
+ elm.src = button.sel;
+ else
+ elm.className = button.sel;
}
}
- };
+ }
+ };
// mouse out of button
this.button_out = function(command, id)
- {
+ {
var a_buttons = this.buttons[command];
- var button, img;
+ var button, elm;
if(!a_buttons || !a_buttons.length)
return;
for(var n=0; n<a_buttons.length; n++)
- {
+ {
button = a_buttons[n];
if(button.id==id && button.status=='act')
- {
- img = document.getElementById(button.id);
- if (img && button.act)
- img.src = button.act;
+ {
+ elm = document.getElementById(button.id);
+ if (elm && button.act) {
+ if (button.type == 'image')
+ elm.src = button.act;
+ else
+ elm.className = button.act;
}
}
- };
+ }
+ };
// write to the document/window title
this.set_pagetitle = function(title)