Sfoglia il codice sorgente

stop propagation on label click

Emanuele Marchi 10 anni fa
parent
commit
ff1b145aa1

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


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

@@ -562,6 +562,9 @@
 
       BootstrapSwitch.prototype._labelHandlers = function() {
         return this.$label.on({
+          "click": function(e) {
+            return e.stopPropagation();
+          },
           "mousedown.bootstrapSwitch touchstart.bootstrapSwitch": (function(_this) {
             return function(e) {
               if (_this._dragStart || _this.options.disabled || _this.options.readonly) {

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


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

@@ -419,6 +419,9 @@ do ($ = window.jQuery, window) ->
 
     _labelHandlers: ->
       @$label.on
+        "click": (e) ->
+          e.stopPropagation()
+
         "mousedown.bootstrapSwitch touchstart.bootstrapSwitch": (e) =>
           return  if @_dragStart or @options.disabled or @options.readonly
 

+ 3 - 0
test/bootstrap-switch.js

@@ -562,6 +562,9 @@
 
       BootstrapSwitch.prototype._labelHandlers = function() {
         return this.$label.on({
+          "click": function(e) {
+            return e.stopPropagation();
+          },
           "mousedown.bootstrapSwitch touchstart.bootstrapSwitch": (function(_this) {
             return function(e) {
               if (_this._dragStart || _this.options.disabled || _this.options.readonly) {

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