Browse Source

Added a change event on the label click

pauloortins 11 years ago
parent
commit
9e0430e50e

+ 6 - 0
dist/js/bootstrap-switch.js

@@ -427,6 +427,12 @@
             return function(e) {
               return _this.$label.trigger("mouseup.bootstrapSwitch");
             };
+          })(this),
+          "click.bootstrapSwitch": (function(_this) {
+            return function(e) {
+              _this.toggleState();
+              return _this.$element.trigger('focus.bootstrapSwitch');
+            };
           })(this)
         });
       };

File diff suppressed because it is too large
+ 0 - 0
dist/js/bootstrap-switch.min.js


+ 4 - 0
src/coffee/bootstrap-switch.coffee

@@ -324,6 +324,10 @@ do ($ = window.jQuery, window) ->
 
         "mouseleave.bootstrapSwitch": (e) =>
           @$label.trigger "mouseup.bootstrapSwitch"
+        
+        "click.bootstrapSwitch": (e) =>
+          @toggleState()
+          @$element.trigger 'focus.bootstrapSwitch'
 
     _formHandler: ->
       $form = @$element.closest "form"

Some files were not shown because too many files changed in this diff