1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 02:27:19 +00:00

Added toggleClass method

This commit is contained in:
Jeremy Ruston 2012-03-30 16:42:54 +01:00
parent ae78b97596
commit 1deb23b82d

View File

@ -259,4 +259,15 @@ utils.removeClass = function(el,className) {
}
};
utils.toggleClass = function(el,className,status) {
if(status === undefined) {
status = !utils.hasClass(el,className);
}
if(status) {
utils.addClass(el,className);
} else {
utils.removeClass(el,className);
}
}
})();