Skip to content

Commit

Permalink
add toggleState event
Browse files Browse the repository at this point in the history
  • Loading branch information
nostalgiaz committed Oct 5, 2012
1 parent 253c954 commit aca69fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions static/js/jquery.toggle.buttons.js
@@ -1,6 +1,6 @@
!function ($) {
"use strict";
// version: 2.3
// "use strict";
// version: 2.4
// by Mattia Larentis - follow me on twitter! @SpiritualGuru

var addToAttribute = function (obj, array, value) {
Expand Down Expand Up @@ -211,6 +211,10 @@
},
toggleActivation: function () {
$(this).toggleClass('deactivate');
},
toggleState: function () {
var $input = $(this).find('input');
$input.attr('checked', !$input.is(':checked')).trigger('change')
}
};

Expand Down

0 comments on commit aca69fb

Please sign in to comment.