浏览代码

Merge pull request #90 from BdMdesigN/master

Fixed HTML Text - switch-mini bug
Stein, Peter 11 年之前
父节点
当前提交
47ae513bda
共有 3 个文件被更改,包括 26 次插入7 次删除
  1. 16 6
      examples/index.html
  2. 1 1
      static/less/bootstrap-switch.less
  3. 9 0
      static/stylesheets/bootstrap-switch.css

+ 16 - 6
examples/index.html

@@ -207,6 +207,22 @@
     </div>
 </div>
 
+<div class="row-fluid">
+    <div class="span12">
+        <h3>HTML text (mini-switch)</h3>
+
+        <div class="bs-docs-example">
+            <div class="switch switch-mini" data-on-label="<i class='switch-mini-icons icon-ok icon-white'></i>" data-off-label="<i class='switch-mini-icons icon-remove'></i>">
+                <input type="checkbox" checked />
+            </div>
+        </div>
+        <pre class="prettyprint linenums">
+&lt;div class="switch switch-mini" data-on-label="&lt;i class='switch-mini-icons icon-ok icon-white'>&lt;/i>" data-off-label="&lt;i class='switch-mini-icons icon-remove'>&lt;/i>">
+    &lt;input type="checkbox" checked />
+&lt;/div></pre>
+    </div>
+</div>
+
 <div class="row-fluid">
     <div class="span12">
         <h3>Event handler <small>javascript</small></h3>
@@ -247,7 +263,6 @@ $('#toggle-state-switch').bootstrapSwitch('setState', false); // true || false</
     </div>
 </div>
 
-
 <div class="row-fluid">
     <div class="span12">
         <h3>Destroy <small>javascript</small></h3>
@@ -281,7 +296,6 @@ $('#create-switch').wrap('&lt;div class="switch" />').parent().bootstrapSwitch()
     </div>
 </div>
 
-
 <div class="row-fluid">
     <div class="span12">
         <h3>Disabled <small>javascript</small></h3>
@@ -313,7 +327,6 @@ $('#disable-switch').bootstrapSwitch('setActive', false);  // true || false</pre
     </div>
 </div>
 
-
 <div class="row-fluid">
     <div class="span12">
         <h3>Radio <small>javascript</small></h3>
@@ -371,7 +384,6 @@ $('#disable-switch').bootstrapSwitch('setActive', false);  // true || false</pre
     </div>
 </div>
 
-
 <div class="row-fluid">
     <div class="span12">
         <h3>Radio <small>javascript (allow radios uncheck)</small></h3>
@@ -421,7 +433,6 @@ $('#disable-switch').bootstrapSwitch('setActive', false);  // true || false</pre
     </div>
 </div>
 
-
 <div class="row-fluid">
     <div class="span12">
         <h3>Form <small>- try to use tab, space and reset button</small></h3>
@@ -516,7 +527,6 @@ $('#disable-switch').bootstrapSwitch('setActive', false);  // true || false</pre
 </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>

+ 1 - 1
static/less/bootstrap-switch.less

@@ -109,7 +109,7 @@
   }
 
   label {
-  	text-align: center;
+    text-align: center;
     margin-top: -1px;
     margin-bottom: -1px;
     z-index: 100;

+ 9 - 0
static/stylesheets/bootstrap-switch.css

@@ -33,6 +33,15 @@
 .has-switch.switch-mini {
   min-width: 72px;
 }
+.has-switch.switch-mini i.switch-mini-icons {
+  height: 1.20em;
+  line-height: 9px;
+  vertical-align: text-top;
+  text-align: center;
+  transform: scale(0.6);
+  margin-top: -1px;
+  margin-bottom: -1px;
+}
 .has-switch.switch-small {
   min-width: 80px;
 }