Browse Source

enhanced bootstrap switch js part in demo

REJack 5 years ago
parent
commit
487ccecf05
1 changed files with 5 additions and 2 deletions
  1. 5 2
      pages/forms/advanced.html

+ 5 - 2
pages/forms/advanced.html

@@ -1286,8 +1286,11 @@
     $('.my-colorpicker2').on('colorpickerChange', function(event) {
       $('.my-colorpicker2 .fa-square').css('color', event.color.toString());
     });
-    
-    $("[data-bootstrap-switch]").bootstrapSwitch();
+
+    $("input[data-bootstrap-switch]").each(function(){
+      $(this).bootstrapSwitch('state', $(this).prop('checked'));
+    });
+
   })
 </script>
 </body>