-/* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+/* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
and is published under the AGPL license. */
var CloseBtn = Class.create({
},
setMessageStatus: function(div, status) {
- return div.removeClassName('error').
- removeClassName('warn').
- removeClassName('info').
- removeClassName('success').
- addClassName(status);
+ $A(["error", "warn", "info", "success", "optional"]).each(function(clname) {
+ div.removeClassName(clname);
+ });
+ if (typeof status === "string") {
+ div.addClassName(status);
+ } else {
+ $A(status).each(function(clname) {
+ div.addClassName(clname);
+ });
+ }
+ return div;
}
});