You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

885 lines
28 KiB

  1. ---
  2. layout : 'default'
  3. css : 'dropdown'
  4. title : 'Dropdown'
  5. description : 'A dropdown allows a user to select a value from a series of options'
  6. type : 'UI Module'
  7. element : 'dropdown'
  8. elementType : 'module'
  9. themes : ['Default']
  10. ---
  11. <link rel="stylesheet/less" type="text/css" href="/build/less/definitions/modules/dropdown.less" />
  12. <script src="/javascript/dropdown.js"></script>
  13. <%- @partial('header', { tabs: 'module' }) %>
  14. <div class="main container">
  15. <div class="ui active tab" data-tab="definition">
  16. <div class="peek">
  17. <div class="ui vertical pointing secondary menu">
  18. <a class="active item">Types</a>
  19. <a class="item">Variations</a>
  20. <a class="item">States</a>
  21. </div>
  22. </div>
  23. <h2 class="ui dividing header">Types</h2>
  24. <div class="dropdown example">
  25. <h4 class="ui header">Dropdown</h4>
  26. <p>A basic dropdown has no special formatting of its own</p>
  27. <div class="ui dropdown">
  28. <div class="text">Select</div>
  29. <i class="dropdown icon"></i>
  30. <div class="menu">
  31. <div class="item">Edit</div>
  32. <div class="item">Remove</div>
  33. <div class="item">Hide</div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="dropdown example">
  38. <h4 class="ui header">Inline</h4>
  39. <p>A dropdown can be formatted to appear inline in other content</p>
  40. <div>Show me posts trending
  41. <div class="ui inline dropdown">
  42. <div class="text">today</div>
  43. <i class="dropdown icon"></i>
  44. <div class="menu">
  45. <div class="item" data-text="today">Today</div>
  46. <div class="item" data-text="this week">This Week</div>
  47. <div class="item" data-text="this month">This Month</div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="dropdown example">
  53. <h4 class="ui header">Selection</h4>
  54. <p>A dropdown can point to other content to show its relationship</p>
  55. <div class="ui selection dropdown">
  56. <input type="hidden" name="gender">
  57. <div class="default text">Gender</div>
  58. <i class="dropdown icon"></i>
  59. <div class="menu">
  60. <div class="item" data-value="1">Male</div>
  61. <div class="item" data-value="0">Female</div>
  62. <div class="item" data-value="2">Unknown</div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="button example">
  67. <h4 class="ui header">Floating</h4>
  68. <p>A dropdown menu can appear to be floating below an element.</p>
  69. <div class="ui teal buttons">
  70. <div class="ui button">Save</div>
  71. <div class="ui floating dropdown icon button">
  72. <i class="dropdown icon"></i>
  73. <div class="menu">
  74. <div class="item"><i class="edit icon"></i> Edit Post</div>
  75. <div class="item"><i class="delete icon"></i> Remove Post</div>
  76. <div class="item"><i class="hide icon"></i> Hide Post</div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="hover example">
  82. <h4 class="ui header">Pointing</h4>
  83. <p>A dropdown can be formatted so that its menu is pointing</p>
  84. <div class="ui menu">
  85. <div class="menu">
  86. <a class="active item">
  87. Home
  88. </a>
  89. <div class="ui pointing dropdown link item">
  90. <i class="dropdown icon"></i>
  91. Messages
  92. <div class="menu">
  93. <a class="item"><i class="mail icon"></i>Inbox</a>
  94. <a class="item"><i class="book icon"></i>Archive</a>
  95. </div>
  96. </div>
  97. <a class="item">
  98. Browse
  99. </a>
  100. <a class="item">
  101. Help
  102. </a>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="another hover example">
  107. <div class="ui vertical menu">
  108. <div class="menu">
  109. <a class="active item">
  110. Home
  111. </a>
  112. <div class="ui left pointing dropdown link item">
  113. <i class="dropdown icon"></i>
  114. Messages
  115. <div class="menu">
  116. <a class="item"><i class="mail icon"></i>Inbox</a>
  117. <a class="item"><i class="book icon"></i>Archive</a>
  118. </div>
  119. </div>
  120. <a class="item">
  121. Browse
  122. </a>
  123. <a class="item">
  124. Help
  125. </a>
  126. </div>
  127. </div>
  128. </div>
  129. <div class="another button example">
  130. <div class="ui blue labeled icon top left pointing dropdown button">
  131. <i class="settings icon"></i>
  132. <span class="text">Settings</span>
  133. <div class="menu">
  134. <div class="item"><i class="edit icon"></i> Edit</div>
  135. <div class="item"><i class="delete icon"></i> Remove</div>
  136. <div class="item"><i class="hide icon"></i> Hide</div>
  137. </div>
  138. </div>
  139. <div class="ui red labeled icon top right pointing dropdown button">
  140. <i class="settings icon"></i>
  141. <span class="text">Settings</span>
  142. <div class="menu">
  143. <div class="item"><i class="edit icon"></i> Edit</div>
  144. <div class="item"><i class="delete icon"></i> Remove</div>
  145. <div class="item"><i class="hide icon"></i> Hide</div>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="another button example">
  150. <div class="ui right pointing dropdown icon button">
  151. <i class="settings icon"></i>
  152. <div class="menu">
  153. <div class="item"><i class="edit icon"></i> Edit</div>
  154. <div class="item"><i class="delete icon"></i> Remove</div>
  155. <div class="item"><i class="hide icon"></i> Hide</div>
  156. </div>
  157. </div>
  158. <div class="ui left pointing dropdown icon button">
  159. <i class="settings icon"></i>
  160. <div class="menu">
  161. <div class="item"><i class="edit icon"></i> Edit</div>
  162. <div class="item"><i class="delete icon"></i> Remove</div>
  163. <div class="item"><i class="hide icon"></i> Hide</div>
  164. </div>
  165. </div>
  166. </div>
  167. <div class="example">
  168. <h4 class="ui header">Simple</h4>
  169. <p>A simple dropdown can open without javascript</p>
  170. <div class="ui compact menu">
  171. <div class="ui simple dropdown item">
  172. <i class="dropdown icon"></i>
  173. Dropdown
  174. <div class="menu">
  175. <div class="item">Choice 1</div>
  176. <div class="item">Choice 2</div>
  177. <div class="item">Choice 3</div>
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. <h2 class="ui dividing header">Variations</h2>
  183. <div class="dropdown example">
  184. <h4 class="ui header">Fluid</h4>
  185. <p>A dropdown can take the full width of its parent</p>
  186. <div class="ui vertical menu">
  187. <a class="item">Link 1</a>
  188. <a class="item">Link 2</a>
  189. <div class="header item">All Sections</div>
  190. <div class="ui item">
  191. <div class="ui fluid selection dropdown">
  192. <div class="text">More</div>
  193. <i class="dropdown icon"></i>
  194. <div class="menu">
  195. <div class="item">Choice 1</div>
  196. <div class="item">Choice 2</div>
  197. <div class="item">Choice 3</div>
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. <h2 class="ui dividing header">States</h2>
  204. <div class="dropdown example">
  205. <h4 class="ui header">Error</h4>
  206. <p>An errored dropddown can alert a user to a problem</p>
  207. <div class="ui floating dropdown error">
  208. Dropdown <i class="dropdown icon"></i>
  209. <div class="menu">
  210. <div class="item">Choice 1</div>
  211. <div class="item">Choice 2</div>
  212. <div class="item">Choice 3</div>
  213. </div>
  214. </div>
  215. <br><br>
  216. <div class="ui selection dropdown error">
  217. Dropdown <i class="dropdown icon"></i>
  218. <div class="menu">
  219. <div class="item">Choice 1</div>
  220. <div class="item">Choice 2</div>
  221. <div class="item">Choice 3</div>
  222. </div>
  223. </div>
  224. </div>
  225. <h4 class="ui header">Simple Dropdown (No Javascript)</h4>
  226. <div class="example">
  227. <h4 class="ui header">Active</h4>
  228. <p>An active dropdown has its menu open</p>
  229. <div class="ui info message">An active state will only affect a simple dropdown. To activate a menu on a dropdown module use <code>$('.ui.dropdown').dropdown('show');</code></div>
  230. <div class="ui simple active dropdown">
  231. Dropdown <i class="dropdown icon"></i>
  232. <div class="menu">
  233. <div class="item">Choice 1</div>
  234. <div class="item">Choice 2</div>
  235. </div>
  236. </div>
  237. </div>
  238. <div class="example">
  239. <h4 class="ui header">Disabled</h4>
  240. <p>A disabled dropdown menu will not open or close</p>
  241. <div class="ui info message">A disabled state will only affect a simple dropdown. To disable a dropdown module use <code>$('.ui.dropdown').dropdown('destroy');</code></div>
  242. <div class="ui simple disabled dropdown">
  243. Dropdown <i class="dropdown icon"></i>
  244. <div class="menu">
  245. <div class="item">Choice 1</div>
  246. <div class="item">Choice 2</div>
  247. <div class="item">Choice 3</div>
  248. </div>
  249. </div>
  250. </div>
  251. </div>
  252. <div class="ui tab" data-tab="usage">
  253. <h2 class="ui dividing header">Initializing</h2>
  254. <h3 class="ui header">Initializing a dropdown</h3>
  255. <div class="code" data-label="HTML" data-type="html">
  256. <div class="ui dropdown">
  257. <div class="text">Select</div>
  258. <i class="dropdown icon"></i>
  259. <div class="menu">
  260. <div class="item" data-value="option1">Option 1</div>
  261. <div class="item" data-value="option2">Option 2</div>
  262. </div>
  263. </div>
  264. </div>
  265. <div class="code" data-label="Javascript" data-type="javascript">
  266. $('.ui.dropdown')
  267. .dropdown()
  268. ;
  269. </div>
  270. <h2 class="ui dividing header">Behavior</h2>
  271. <p>All the following <a href="/module.html#/behavior">behaviors</a> can be called using the syntax:</p>
  272. <div class="code">
  273. $('.your.element')
  274. .dropdown('behavior name', argumentOne, argumentTwo)
  275. ;
  276. </div>
  277. <table class="ui definition sortable celled table segment">
  278. <thead>
  279. <tr>
  280. <th>Behavior</th>
  281. <th>Description</th>
  282. </tr>
  283. </thead>
  284. <tbody>
  285. <tr>
  286. <td>toggle</td>
  287. <td>Toggles current visibility of dropdown</td>
  288. </tr>
  289. <tr>
  290. <td>show</td>
  291. <td>Shows dropdown</td>
  292. </tr>
  293. <tr>
  294. <td>hide</td>
  295. <td>Hides dropdown</td>
  296. </tr>
  297. <tr>
  298. <td>hide others</td>
  299. <td>Hides all other dropdowns that is not current dropdown</td>
  300. </tr>
  301. <tr>
  302. <td>restore defaults</td>
  303. <td>Restores dropdown text and value to its value on page load</td>
  304. </tr>
  305. <tr>
  306. <td>restore default text</td>
  307. <td>Restores dropdown text to its value on page load</td>
  308. </tr>
  309. <tr>
  310. <td>restore default value</td>
  311. <td>Restores dropdown value to its value on page load</td>
  312. </tr>
  313. <tr>
  314. <td>save defaults</td>
  315. <td>Saves current text and value as new defaults (for use with restore)</td>
  316. </tr>
  317. <tr>
  318. <td>set selected(value)</td>
  319. <td>Sets selected state to a given value</td>
  320. </tr>
  321. <tr>
  322. <td>set text(text)</td>
  323. <td>Sets dropdown text to a value</td>
  324. </tr>
  325. <tr>
  326. <td>set value(value)</td>
  327. <td>Sets dropdown input to value</td>
  328. </tr>
  329. <tr>
  330. <td>get text</td>
  331. <td>Returns current dropdown text</td>
  332. </tr>
  333. <tr>
  334. <td>get value</td>
  335. <td>Returns current dropdown input value</td>
  336. </tr>
  337. <tr>
  338. <td>get item(value)</td>
  339. <td>Returns DOM element that matches a given input value</td>
  340. </tr>
  341. <tr>
  342. <td>bind touch events</td>
  343. <td>Adds touch events to element</td>
  344. </tr>
  345. <tr>
  346. <td>mouse events</td>
  347. <td>Adds mouse events to element</td>
  348. </tr>
  349. <tr>
  350. <td>bind intent</td>
  351. <td>Binds a click to document to determine if you click away from a dropdown</td>
  352. </tr>
  353. <tr>
  354. <td>unbind intent</td>
  355. <td>Unbinds document intent click</td>
  356. </tr>
  357. <tr>
  358. <td>determine intent</td>
  359. <td>Returns whether event occurred inside dropdown</td>
  360. </tr>
  361. <tr>
  362. <td>determine select action(text, value)</td>
  363. <td>Triggers preset item selection action based on settings passing text/value</td>
  364. </tr>
  365. <tr>
  366. <td>set active</td>
  367. <td>Sets dropdown to active state
  368. <tr>
  369. <td>set visible</td>
  370. <td>Sets dropdown to visible state</td>
  371. </tr>
  372. <tr>
  373. <td>remove active</td>
  374. <td>rRemoves dropdown active state
  375. <tr>
  376. <td>remove visible</td>
  377. <td>Removes dropdown visible state</td>
  378. </tr>
  379. <tr>
  380. <td>is selection</td>
  381. <td>Returns whether dropdown is a selection dropdown</td>
  382. </tr>
  383. <tr>
  384. <td>is animated</td>
  385. <td>Returns whether dropdown is animated</td>
  386. </tr>
  387. <tr>
  388. <td>is visible</td>
  389. <td>Returns whether dropdown is visible</td>
  390. </tr>
  391. <tr>
  392. <td>is hidden</td>
  393. <td>Returns whether dropdown is hidden</td>
  394. </tr>
  395. </tbody>
  396. </table>
  397. </div>
  398. <div class="ui tab" data-tab="examples">
  399. <div class="transition example">
  400. <h3 class="ui header">Changing Transitions</h3>
  401. <p>A dropdown can specify a different <a href="/modules/transition.html">transitions</a>.</p>
  402. <div class="code" data-type="javascript">
  403. $('.dropdown')
  404. .dropdown({
  405. // you can use any ui transition
  406. transition: 'drop'
  407. })
  408. ;
  409. </div>
  410. <div class="ui teal buttons">
  411. <div class="ui button">Toggle</div>
  412. <div class="ui floating dropdown icon button">
  413. <i class="dropdown icon"></i>
  414. <div class="menu">
  415. <div class="item" data-value="drop">Drop</div>
  416. <div class="item" data-value="horizontal flip">Horizontal Flip</div>
  417. <div class="item" data-value="fade up">Fade Up</div>
  418. <div class="item" data-value="scale">Scale</div>
  419. </div>
  420. </div>
  421. </div>
  422. </div>
  423. <div class="dropdown example">
  424. <h3 class="ui header">Multiple Levels</h3>
  425. <p>A dropdown menu can also contain sub menus inside of it</p>
  426. My favorite animal breed is <div class="ui inline dropdown">
  427. <input type="hidden" name="gender">
  428. <div class="text">Shiba Inu</div>
  429. <i class="dropdown icon"></i>
  430. <div class="menu">
  431. <div class="item">
  432. <i class="dropdown icon"></i>
  433. Dogs
  434. <div class="menu">
  435. <div class="item">Shiba Inu</div>
  436. <div class="item">Poodle</div>
  437. <div class="item">Labrador</div>
  438. </div>
  439. </div>
  440. <div class="item">
  441. <i class="dropdown icon"></i>
  442. Cats
  443. <div class="menu">
  444. <div class="item">Aegean</div>
  445. <div class="item">Balinese</div>
  446. <div class="item">Persian</div>
  447. </div>
  448. </div>
  449. </div>
  450. </div>
  451. </div>
  452. <div class="dropdown example">
  453. <h3 class="ui header">Preserving User Selections</h3>
  454. <p>This example uses a preset text value to preserve the menu item on page navigation</p>
  455. <div class="ui ignored info icon message">
  456. <i class="help circle icon"></i>
  457. <div class="content">
  458. <p>A dropdown will automatically select on page load any menu item that includes the currently value of <code>text</code> or your dropdown's <code>hidden input</code> value.</p>
  459. <p>This is used to preserve a user's selection on page navigation and will automatically remove and default text placeholder formatting.</p>
  460. </div>
  461. </div>
  462. Current action: <div class="ui inline dropdown">
  463. <div class="text">Hide</div>
  464. <i class="dropdown icon"></i>
  465. <div class="menu">
  466. <div class="item">Edit</div>
  467. <div class="item">Remove</div>
  468. <div class="item">Hide</div>
  469. </div>
  470. </div>
  471. </div>
  472. <div class="dropdown example">
  473. <h3 class="ui header">Button Group</h3>
  474. <p>A <a href="/elements/button.html">button group</a> can be formatted to show additional content as a dropdown</p>
  475. <div class="ui icon buttons">
  476. <div class="ui top left pointing dropdown button">
  477. <i class="user icon"></i>
  478. <div class="menu">
  479. <div class="item"><i class="edit icon"></i>Edit User</div>
  480. <div class="item"><i class="delete icon"></i>Remove User</div>
  481. <div class="item"><i class="hide icon"></i>Make Invisible</div>
  482. </div>
  483. </div>
  484. <div class="ui top left pointing dropdown button">
  485. <i class="users icon"></i>
  486. <div class="menu">
  487. <div class="item"><i class="edit icon"></i>Edit Group</div>
  488. <div class="item"><i class="delete icon"></i>Remove Group</div>
  489. <div class="item"><i class="hide icon"></i>Hide from Group</div>
  490. </div>
  491. </div>
  492. <div class="ui top right pointing dropdown button">
  493. <i class="settings icon"></i>
  494. <div class="menu">
  495. <div class="item"><i class="edit icon"></i> Edit</div>
  496. <div class="item"><i class="delete icon"></i> Remove</div>
  497. <div class="item"><i class="hide icon"></i> Hide</div>
  498. </div>
  499. </div>
  500. </div>
  501. </div>
  502. <div class="hover example">
  503. <h3 class="ui header">Menu</h3>
  504. <p>A <a href="/collections/menu.html">menu</a> element can contain a dropdown</p>
  505. <div class="ui tiered purple inverted menu">
  506. <div class="menu">
  507. <a class="active item">
  508. Home
  509. </a>
  510. <a class="ui dropdown item">
  511. <i class="dropdown icon"></i>Messages
  512. <div class="menu">
  513. <div class="item">
  514. <i class="dropdown icon"></i>
  515. Categories
  516. <div class="menu">
  517. <div class="item">Unread</div>
  518. <div class="item">Promotions</div>
  519. <div class="item">Updates</div>
  520. </div>
  521. </div>
  522. <div class="item">Archive</div>
  523. </div>
  524. </a>
  525. <a class="item">
  526. Browse
  527. </a>
  528. </div>
  529. <div class="sub menu">
  530. <a class="item">Activity Feed</a>
  531. <a class="item">Profile</a>
  532. <a class="item">Events</a>
  533. </div>
  534. </div>
  535. </div>
  536. <div class="dropdown example">
  537. <h3 class="ui header">Form</h3>
  538. <p>A dropdown can be formatted to allow selection inside a <a href="/collections/form.html">form</a></p>
  539. <div class="ui form segment">
  540. <p>Let's go ahead and get you signed up.</p>
  541. <div class="two fields">
  542. <div class="field">
  543. <label>First Name</label>
  544. <input placeholder="First Name" type="text">
  545. </div>
  546. <div class="field">
  547. <label>Last Name</label>
  548. <input placeholder="Last Name" type="text">
  549. </div>
  550. </div>
  551. <div class="field">
  552. <label>Gender</label>
  553. <div class="ui dropdown selection">
  554. <input type="hidden" name="gender">
  555. <div class="default text">...</div>
  556. <i class="dropdown icon"></i>
  557. <div class="menu">
  558. <div class="item" data-value="male">Male</div>
  559. <div class="item" data-value="female">Female</div>
  560. </div>
  561. </div>
  562. </div>
  563. </div>
  564. </div>
  565. <h3 class="ui dividing header">Using Different Dropdown Actions</h3>
  566. <div class="button example">
  567. <h4 class="ui header">Combo Dropdowns</h4>
  568. <div class="ignored">
  569. <p>A <a href="/elements/button.html">button</a> can be formatted with a dropdown.</p>
  570. <p>You can change the default action that occurs on selection to different presets built into <em>ui dropdown</em>.</p>
  571. <p>For example, using the <code>combo</code> preset will change the preceding buttons text value to the current selected alue</p>
  572. <div class="evaluated code" data-type="javascript">
  573. $('.combo.dropdown')
  574. .dropdown({
  575. action: 'combo'
  576. })
  577. ;
  578. </div>
  579. <div class="ui teal buttons">
  580. <div class="ui button">Save</div>
  581. <div class="ui combo dropdown icon button">
  582. <i class="dropdown icon"></i>
  583. <div class="menu">
  584. <div class="item"><i class="edit icon"></i> Edit</div>
  585. <div class="item"><i class="delete icon"></i> Delete</div>
  586. <div class="item"><i class="hide icon"></i> Hide</div>
  587. </div>
  588. </div>
  589. </div>
  590. </div>
  591. <div class="button example">
  592. <h4 class="ui header">Link Dropdowns</h4>
  593. <div class="ignored">
  594. <p>If each option in your dropdown links out to another page, you might just want to make your menu hide without changing any value.</p>
  595. <div class="evaluated code" data-type="javascript">
  596. $('.link.dropdown')
  597. .dropdown({
  598. action: 'hide'
  599. })
  600. ;
  601. </div>
  602. <div class="ui link dropdown icon button">
  603. <div class="text">Go to</div>
  604. <i class="dropdown icon"></i>
  605. <div class="menu">
  606. <a class="item" href="#link1"><i class="home icon"></i> Home</a>
  607. <a class="item" href="#link2"><i class="users icon"></i> Browse</a>
  608. <a class="item" href="#link3"><i class="search icon"></i> Search</a>
  609. </div>
  610. </div>
  611. </div>
  612. </div>
  613. <div class="ui tab" data-tab="settings">
  614. <h3 class="ui header">
  615. Dropdown Settings
  616. <div class="sub header">Dropdown settings modify the dropdown's behavior</div>
  617. </h3>
  618. <table class="ui celled sortable definition table segment">
  619. <thead>
  620. <tr>
  621. <th>Setting</th>
  622. <th class="four wide">Default</th>
  623. <th>Description</th>
  624. </tr>
  625. </thead>
  626. <tbody>
  627. <tr>
  628. <td>on</td>
  629. <td>click</td>
  630. <td>Event used to trigger dropdown (Hover, Click)</td>
  631. </tr>
  632. <tr>
  633. <td>delay</td>
  634. <td>
  635. <div class="code">
  636. delay: {
  637. show: 50,
  638. hide: 300
  639. }
  640. </div>
  641. </td>
  642. <td>Time in milliseconds to debounce show or hide behavior when <code>on: hover</code> is used.</td>
  643. </tr>
  644. <tr>
  645. <td>transition</td>
  646. <td>
  647. slide down
  648. </td>
  649. <td>Named transition to use when animating menu in and out. Fade and slide down are available without including <a href="/modules/transition.html">ui transitions</a></td>
  650. </tr>
  651. <tr>
  652. <td>duration</td>
  653. <td>
  654. 250
  655. </td>
  656. <td>Duration of animation events</td>
  657. </tr>
  658. <tr>
  659. <td>action</td>
  660. <td>auto</td>
  661. <td>Sets a default action to occur.
  662. <div class="ui vertical divided list">
  663. <div class="item">
  664. <div class="header">activate</div>
  665. <div class="description">Most likely action will be determined by type of dropdown, for example a selection dropdown will automatically use updateForm</div>
  666. </div>
  667. <div class="item">
  668. <div class="header">combo</div>
  669. <div class="description">changes text of previous element matching text selector</div>
  670. </div>
  671. <div class="item">
  672. <div class="header">select</div>
  673. <div class="description">activates menu item but does not change text</div>
  674. </div>
  675. <div class="item">
  676. <div class="header">nothing</div>
  677. <div class="description">no action occurs</div>
  678. </div>
  679. <div class="item">
  680. <div class="header">hide</div>
  681. <div class="description">Dropdown menu is hidden</div>
  682. </div>
  683. <div class="item">
  684. <div class="header">function(){}</div>
  685. <div class="description">custom function is executed</div>
  686. </div>
  687. </div>
  688. </tr>
  689. </tbody>
  690. </table>
  691. <div class="ui horizontal section divider"><i class="icon setting"></i></div>
  692. <h3 class="ui header">
  693. Callbacks
  694. <div class="sub header">Callbacks specify a function to occur after a specific behavior.</div>
  695. </h3>
  696. <table class="ui celled sortable definition table segment">
  697. <thead>
  698. <tr>
  699. <th class="four wide">Setting</th>
  700. <th>Context</th>
  701. <th>Description</th>
  702. </tr>
  703. </thead>
  704. <tbody>
  705. <tr>
  706. <td>onChange(value, text)</td>
  707. <td>Dropdown</td>
  708. <td>Is called after a dropdown item is selected. receives the name and value of selection.</td>
  709. </tr>
  710. <tr>
  711. <td>onShow</td>
  712. <td>Dropdown</td>
  713. <td>Is called after a dropdown is shown.</td>
  714. </tr>
  715. <tr>
  716. <td>onHide</td>
  717. <td>Dropdown</td>
  718. <td>Is called after a dropdown is hidden.</td>
  719. </tr>
  720. </tbody>
  721. </table>
  722. <h3 class="ui header">
  723. DOM Settings
  724. <div class="sub header">DOM settings specify how this module should interface with the DOM</div>
  725. </h3>
  726. <table class="ui celled sortable definition table segment">
  727. <thead>
  728. <tr>
  729. <th>Setting</th>
  730. <th class="four wide">Default</th>
  731. <th>Description</th>
  732. </tr>
  733. </thead>
  734. <tbody>
  735. <tr>
  736. <td>namespace</td>
  737. <td>dropdown</td>
  738. <td>Event namespace. Makes sure module teardown does not effect other events attached to an element.</td>
  739. </tr>
  740. <tr>
  741. <td>selector</td>
  742. <td colspan="2">
  743. <div class="code">
  744. selector : {
  745. input : '> input[type="hidden"]',
  746. item : '.menu > .item',
  747. menu : '.menu',
  748. text : '> .text'
  749. }
  750. </div>
  751. </td>
  752. </tr>
  753. <tr>
  754. <td>metadata</td>
  755. <td colspan="2">
  756. <div class="code">
  757. metadata: {
  758. text : 'text',
  759. value : 'value'
  760. }
  761. </div>
  762. </td>
  763. </tr>
  764. <tr>
  765. <td>className</td>
  766. <td colspan="2">
  767. <div class="code">
  768. className : {
  769. active : 'active',
  770. disabled : 'disabled',
  771. placeholder : 'default',
  772. visible : 'visible'
  773. }
  774. </div>
  775. </td>
  776. </tr>
  777. </tbody>
  778. </table>
  779. <h3 class="ui header">
  780. Debug Settings
  781. <div class="sub header">Debug settings controls debug output to the console</div>
  782. </h3>
  783. <table class="ui celled sortable definition table segment">
  784. <thead>
  785. <tr>
  786. <th>Setting</th>
  787. <th class="four wide">Default</th>
  788. <th>Description</th>
  789. </tr>
  790. </thead>
  791. <tbody>
  792. <tr>
  793. <td>name</td>
  794. <td>Dropdown</td>
  795. <td>Name used in debug logs</td>
  796. </tr>
  797. <tr>
  798. <td>debug</td>
  799. <td>True</td>
  800. <td>Provides standard debug output to console</td>
  801. </tr>
  802. <tr>
  803. <td>performance</td>
  804. <td>True</td>
  805. <td>Provides standard debug output to console</td>
  806. </tr>
  807. <tr>
  808. <td>verbose</td>
  809. <td>True</td>
  810. <td>Provides ancillary debug output to console</td>
  811. </tr>
  812. <tr>
  813. <td>error</td>
  814. <td colspan="2">
  815. <div class="code">
  816. error : {
  817. action : 'You called a dropdown action that was not defined',
  818. method : 'The method you called is not defined.',
  819. transition : 'The requested transition was not found'
  820. }
  821. </div>
  822. </td>
  823. </tr>
  824. </tbody>
  825. </table>
  826. </div>
  827. </div>