Pārlūkot izejas kodu

Form reset improvement, now restoring to the original checkbox state instead of setting it to false.

Carlos Guimarães 11 gadi atpakaļ
vecāks
revīzija
a209920dad

+ 1 - 1
dist/js/bootstrap-switch.js

@@ -418,7 +418,7 @@
             return $form.find("input").filter(function() {
               return $(this).data("bootstrap-switch");
             }).each(function() {
-              return $(this).bootstrapSwitch("state", false);
+              return $(this).bootstrapSwitch("state", this.checked);
             });
           }, 1);
         }).data("bootstrap-switch", true);

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/bootstrap-switch.min.js


+ 1 - 1
src/coffee/bootstrap-switch.coffee

@@ -310,7 +310,7 @@ do ($ = window.jQuery, window) ->
           $form
           .find("input")
           .filter( -> $(@).data "bootstrap-switch")
-          .each -> $(@).bootstrapSwitch "state", false
+          .each -> $(@).bootstrapSwitch "state", @checked
         , 1
       .data "bootstrap-switch", true
 

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels