documentation-2.jade 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. extends main
  2. block content
  3. #content.bs-docs-header
  4. .container
  5. h1 Documentation
  6. p v2.0.1
  7. .container
  8. #options
  9. h2.page-header Options
  10. .alert.alert-warning
  11. p
  12. | All the options are accepted only using <code>data-*</code> attributes on the element.<br>
  13. | <code>checked</code>, <code>disabled</code> and <code>readonly</code> are exception to the rule, being
  14. | default HTML input attributes.<br>
  15. | Therefore, there is not any way to specify the options in JavaScript during initialization.
  16. table.table.table-bordered.table-striped.table-responsive
  17. thead
  18. tr
  19. th Name
  20. th Type
  21. th Description
  22. th Values
  23. th Default
  24. tbody
  25. tr
  26. td state
  27. td Boolean
  28. td The checkbox state
  29. td true, false
  30. td 'checked' attribute or true
  31. tr
  32. td size
  33. td String
  34. td The checkbox state
  35. td '', 'mini', 'small', 'normal', 'large'
  36. td ''
  37. tr
  38. td animate
  39. td Boolean
  40. td Animate the switch
  41. td true, false
  42. td true
  43. tr
  44. td disabled
  45. td Boolean
  46. td Disable state
  47. td true, false
  48. td 'disabled' attribute or false
  49. tr
  50. td readonly
  51. td Boolean
  52. td Readonly state
  53. td true, false
  54. td 'readonly' attribute or false
  55. tr
  56. td on
  57. td String
  58. td Color of the left side of the switch
  59. td 'primary', 'info', 'success', 'warning', 'danger', 'default'
  60. td null
  61. tr
  62. td off
  63. td String
  64. td Color of the right side of the switch
  65. td 'primary', 'info', 'success', 'warning', 'danger', 'default'
  66. td null
  67. tr
  68. td on-label
  69. td String
  70. td Text of the left side of the switch
  71. td String
  72. td 'ON'
  73. tr
  74. td off-label
  75. td String
  76. td Text of the right side of the switch
  77. td String
  78. td 'OFF'
  79. tr
  80. td label-text
  81. td String
  82. td Text of the center handle of the switch
  83. td String
  84. td '&amp;nbsp;'
  85. tr
  86. td label-icon
  87. td String
  88. td Text of the center handle of the switch. Use to include external services icons
  89. td String
  90. td null
  91. #methods
  92. h2.page-header Methods
  93. table.table.table-bordered.table-striped.table-responsive
  94. thead
  95. tr
  96. th Name
  97. th Description
  98. th Accepted Values
  99. th Returned Values
  100. tbody
  101. tr
  102. td state
  103. td Get checkbox state
  104. td
  105. td true, false
  106. tr
  107. td setState
  108. td Set checkbox state
  109. td (value: true, false)[, skip: true, <strong>false</strong>]
  110. td jQuery Object (input element)
  111. tr
  112. td toggleState
  113. td Toggle checkbox state
  114. td [skip: true, <strong>false</strong>]
  115. td jQuery Object (input element)
  116. tr
  117. td toggleRadioState
  118. td Toggle radio state
  119. td [skip: true, <strong>false</strong>]
  120. td jQuery Object (input element)
  121. tr
  122. td toggleRadioStateAllowUncheck
  123. td Toggle radio state allowing uncheck of the radio input
  124. td [uncheck: true, <strong>false</strong> | skip: true, <strong>false</strong>]
  125. td jQuery Object (input element)
  126. tr
  127. td setSizeClass
  128. td Set the size of the switch
  129. td '', 'mini', 'small', 'normal', 'large'
  130. td jQuery Object (input element)
  131. tr
  132. td setAnimated
  133. td Animate the switch
  134. td true, false
  135. td jQuery Object (input element)
  136. tr
  137. td isDisabled
  138. td Get disabled state
  139. td
  140. td true, false
  141. tr
  142. td setDisabled
  143. td Set disable state
  144. td true, false
  145. td jQuery Object (input element)
  146. tr
  147. td toggleDisabled
  148. td Toggle disabled state
  149. td
  150. td jQuery Object (input element)
  151. tr
  152. td isReadOnly
  153. td Get Readonly state
  154. td
  155. td true, false
  156. tr
  157. td setReadOnly
  158. td Set Readonly state
  159. td true, false
  160. td jQuery Object (input element)
  161. tr
  162. td toggleReadOnly
  163. td Toggle readonly state
  164. td
  165. td jQuery Object (input element)
  166. tr
  167. td setOnClass
  168. td Color of the left side of the switch
  169. td 'primary', 'info', 'success', 'warning', 'danger', 'default'
  170. td jQuery Object (input element)
  171. tr
  172. td setOffClass
  173. td Color of the right side of the switch
  174. td 'primary', 'info', 'success', 'warning', 'danger', 'default'
  175. td jQuery Object (input element)
  176. tr
  177. td setOnLabel
  178. td Text of the left side of the switch
  179. td String
  180. td jQuery Object (input element)
  181. tr
  182. td setOffLabel
  183. td Text of the right side of the switch
  184. td String
  185. td jQuery Object (input element)
  186. tr
  187. td setTextLabel
  188. td Text of the center handle of the switch
  189. td String
  190. td null
  191. tr
  192. td setTextIcon
  193. td Text of the center handle of the switch. Use to include external services icons
  194. td String
  195. td null
  196. tr
  197. td destroy
  198. td Destroy the instance of Bootstrap Switch
  199. td
  200. td jQuery Object (input element)
  201. #events
  202. h2.page-header Events
  203. p
  204. | The only event triggered it <code>switch-change</code>. It returns two parameters: <code>event</code> and
  205. | <code>data</code>.<br>
  206. | The latter is an object that include <code>el</code> (the input DOM element) and <code>value</code> (the
  207. | new input state)