|
@@ -258,6 +258,20 @@ $('#destroy-switch').bootstrapSwitch('destroy');</pre>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+<div class="row-fluid">
|
|
|
+ <div class="span12">
|
|
|
+ <h3>Create <small>javascript</small></h3>
|
|
|
+ <div class="bs-docs-example">
|
|
|
+ <input id="create-switch" type="checkbox" checked />
|
|
|
+ <br>
|
|
|
+ <br>
|
|
|
+ <div id="btn-create" class="btn">Create</div>
|
|
|
+ </div>
|
|
|
+ <pre class="prettyprint linenums">
|
|
|
+$('#create-switch').wrap('<div class="switch" />').parent().bootstrapSwitch();</pre>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
|
|
|
<div class="row-fluid">
|
|
|
<div class="span12">
|
|
@@ -351,13 +365,49 @@ $('#disable-switch').bootstrapSwitch('setActive', false); // true || false</pre
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+
|
|
|
+<div class="row-fluid">
|
|
|
+ <div class="span12">
|
|
|
+ <h3>Modal</h3>
|
|
|
+
|
|
|
+ <div class="bs-docs-example">
|
|
|
+ <a href="#myModal" role="button" class="btn" data-toggle="modal">Modal</a>
|
|
|
+ </div>
|
|
|
+ <pre class="prettyprint linenums">
|
|
|
+<a href="#myModal" role="button" class="btn" data-toggle="modal">Modal</a>
|
|
|
+-----
|
|
|
+<div class="modal-body">
|
|
|
+ <div class="switch">
|
|
|
+ <input type="checkbox" checked />
|
|
|
+ </div>
|
|
|
+</div></pre>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
<p class="pull-right">
|
|
|
<a href="https://twitter.com/SpiritualGuru">follow me</a> -
|
|
|
<a href="http://www.larentis.eu">my site</a>
|
|
|
</p>
|
|
|
</div>
|
|
|
|
|
|
+
|
|
|
+<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
|
+ <div class="modal-header">
|
|
|
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
+ <h3>Modal</h3>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="switch">
|
|
|
+ <input type="checkbox" checked />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
|
|
|
+<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
|
|
|
<script src="http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.js"></script>
|
|
|
<script src="../static/js/bootstrapSwitch.js"></script>
|
|
|
<script>
|
|
@@ -385,6 +435,11 @@ $('#disable-switch').bootstrapSwitch('setActive', false); // true || false</pre
|
|
|
$(this).remove();
|
|
|
});
|
|
|
|
|
|
+ $('#btn-create').on('click', function () {
|
|
|
+ $('#create-switch').wrap('<div class="switch" />').parent().bootstrapSwitch();
|
|
|
+ $(this).remove()
|
|
|
+ });
|
|
|
+
|
|
|
$('#btn-is-active-switch').on('click', function () {
|
|
|
alert($('#disable-switch').bootstrapSwitch('isActive'));
|
|
|
});
|