librenms/html/js/jquery-checkbox.js
Adam Amstrong 7d2a253599 port ignore patch, from paul gear
git-svn-id: http://www.observium.org/svn/observer/trunk@2006 61d68cd4-352d-0410-923a-c4978735b2b8
2011-04-02 12:08:08 +00:00

21 lines
514 B
JavaScript

// Checkbox manipulation function from http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
// assumed to be under the same license as jQuery itself: MIT or GPLv2
jQuery.fn.check = function(mode) {
// if mode is undefined, use 'on' as default
var mode = mode || 'on';
return this.each(function() {
switch(mode) {
case 'on':
this.checked = true;
break;
case 'off':
this.checked = false;
break;
case 'toggle':
this.checked = !this.checked;
break;
}
});
};