fomantic-ui 2.9.0-beta.32 → 2.9.0-beta.321

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (424) hide show
  1. package/.all-contributorsrc +274 -4
  2. package/.github/codeql/codeql-config.yml +4 -0
  3. package/.github/dependabot.yml +10 -0
  4. package/.github/workflows/ci.yml +10 -6
  5. package/.github/workflows/codeql.yml +68 -0
  6. package/.github/workflows/nightly.yml +16 -8
  7. package/.github/workflows/release.yml +34 -0
  8. package/CONTRIBUTORS.md +86 -37
  9. package/FAQ.md +38 -38
  10. package/README.md +8 -8
  11. package/dist/components/accordion.css +176 -36
  12. package/dist/components/accordion.js +10 -4
  13. package/dist/components/accordion.min.css +2 -2
  14. package/dist/components/accordion.min.js +3 -3
  15. package/dist/components/ad.css +4 -4
  16. package/dist/components/ad.min.css +2 -2
  17. package/dist/components/api.js +92 -33
  18. package/dist/components/api.min.js +3 -3
  19. package/dist/components/breadcrumb.css +1 -1
  20. package/dist/components/breadcrumb.min.css +1 -1
  21. package/dist/components/button.css +204 -157
  22. package/dist/components/button.min.css +2 -2
  23. package/dist/components/calendar.css +18 -1
  24. package/dist/components/calendar.js +93 -74
  25. package/dist/components/calendar.min.css +2 -2
  26. package/dist/components/calendar.min.js +3 -3
  27. package/dist/components/card.css +754 -117
  28. package/dist/components/card.min.css +2 -2
  29. package/dist/components/checkbox.css +92 -91
  30. package/dist/components/checkbox.js +21 -14
  31. package/dist/components/checkbox.min.css +2 -2
  32. package/dist/components/checkbox.min.js +3 -3
  33. package/dist/components/comment.css +12 -12
  34. package/dist/components/comment.min.css +2 -2
  35. package/dist/components/container.css +98 -4
  36. package/dist/components/container.min.css +2 -2
  37. package/dist/components/dimmer.css +33 -18
  38. package/dist/components/dimmer.js +19 -10
  39. package/dist/components/dimmer.min.css +2 -2
  40. package/dist/components/dimmer.min.js +3 -3
  41. package/dist/components/divider.css +31 -31
  42. package/dist/components/divider.min.css +2 -2
  43. package/dist/components/dropdown.css +100 -50
  44. package/dist/components/dropdown.js +212 -187
  45. package/dist/components/dropdown.min.css +2 -2
  46. package/dist/components/dropdown.min.js +3 -3
  47. package/dist/components/embed.css +5 -5
  48. package/dist/components/embed.js +14 -10
  49. package/dist/components/embed.min.css +2 -2
  50. package/dist/components/embed.min.js +3 -3
  51. package/dist/components/emoji.css +10799 -8841
  52. package/dist/components/emoji.min.css +1 -1
  53. package/dist/components/feed.css +29 -29
  54. package/dist/components/feed.min.css +2 -2
  55. package/dist/components/flag.css +1021 -915
  56. package/dist/components/flag.min.css +2 -2
  57. package/dist/components/flyout.css +592 -0
  58. package/dist/components/flyout.js +1529 -0
  59. package/dist/components/flyout.min.css +9 -0
  60. package/dist/components/flyout.min.js +11 -0
  61. package/dist/components/form.css +160 -83
  62. package/dist/components/form.js +46 -42
  63. package/dist/components/form.min.css +2 -2
  64. package/dist/components/form.min.js +3 -3
  65. package/dist/components/grid.css +25 -21
  66. package/dist/components/grid.min.css +2 -2
  67. package/dist/components/header.css +6 -4
  68. package/dist/components/header.min.css +2 -2
  69. package/dist/components/icon.css +2063 -1984
  70. package/dist/components/icon.min.css +2 -2
  71. package/dist/components/image.css +1 -1
  72. package/dist/components/image.min.css +1 -1
  73. package/dist/components/input.css +759 -22
  74. package/dist/components/input.min.css +2 -2
  75. package/dist/components/item.css +17 -17
  76. package/dist/components/item.min.css +2 -2
  77. package/dist/components/label.css +72 -68
  78. package/dist/components/label.min.css +2 -2
  79. package/dist/components/list.css +31 -31
  80. package/dist/components/list.min.css +2 -2
  81. package/dist/components/loader.css +352 -352
  82. package/dist/components/loader.min.css +2 -2
  83. package/dist/components/menu.css +108 -76
  84. package/dist/components/menu.min.css +1 -1
  85. package/dist/components/message.css +43 -43
  86. package/dist/components/message.min.css +2 -2
  87. package/dist/components/modal.css +37 -6
  88. package/dist/components/modal.js +187 -84
  89. package/dist/components/modal.min.css +2 -2
  90. package/dist/components/modal.min.js +3 -3
  91. package/dist/components/nag.css +1 -1
  92. package/dist/components/nag.js +3 -3
  93. package/dist/components/nag.min.css +1 -1
  94. package/dist/components/nag.min.js +3 -3
  95. package/dist/components/placeholder.css +33 -33
  96. package/dist/components/placeholder.min.css +2 -2
  97. package/dist/components/popup.css +100 -104
  98. package/dist/components/popup.js +17 -23
  99. package/dist/components/popup.min.css +2 -2
  100. package/dist/components/popup.min.js +3 -3
  101. package/dist/components/progress.css +1 -1
  102. package/dist/components/progress.js +6 -3
  103. package/dist/components/progress.min.css +1 -1
  104. package/dist/components/progress.min.js +3 -3
  105. package/dist/components/rail.css +1 -1
  106. package/dist/components/rail.min.css +1 -1
  107. package/dist/components/rating.css +1 -1
  108. package/dist/components/rating.js +8 -4
  109. package/dist/components/rating.min.css +1 -1
  110. package/dist/components/rating.min.js +3 -3
  111. package/dist/components/reset.css +5 -4
  112. package/dist/components/reset.min.css +2 -2
  113. package/dist/components/reveal.css +1 -1
  114. package/dist/components/reveal.min.css +1 -1
  115. package/dist/components/search.css +6 -6
  116. package/dist/components/search.js +48 -21
  117. package/dist/components/search.min.css +2 -2
  118. package/dist/components/search.min.js +3 -3
  119. package/dist/components/segment.css +118 -34
  120. package/dist/components/segment.min.css +2 -2
  121. package/dist/components/shape.css +1 -1
  122. package/dist/components/shape.js +4 -4
  123. package/dist/components/shape.min.css +1 -1
  124. package/dist/components/shape.min.js +3 -3
  125. package/dist/components/sidebar.css +23 -9
  126. package/dist/components/sidebar.js +141 -44
  127. package/dist/components/sidebar.min.css +2 -2
  128. package/dist/components/sidebar.min.js +3 -3
  129. package/dist/components/site.css +139 -42
  130. package/dist/components/site.js +2 -2
  131. package/dist/components/site.min.css +2 -2
  132. package/dist/components/site.min.js +3 -3
  133. package/dist/components/slider.css +17 -17
  134. package/dist/components/slider.js +79 -64
  135. package/dist/components/slider.min.css +1 -1
  136. package/dist/components/slider.min.js +3 -3
  137. package/dist/components/state.js +3 -3
  138. package/dist/components/state.min.js +3 -3
  139. package/dist/components/statistic.css +4 -4
  140. package/dist/components/statistic.min.css +2 -2
  141. package/dist/components/step.css +31 -31
  142. package/dist/components/step.min.css +2 -2
  143. package/dist/components/sticky.css +1 -1
  144. package/dist/components/sticky.js +11 -18
  145. package/dist/components/sticky.min.css +1 -1
  146. package/dist/components/sticky.min.js +3 -3
  147. package/dist/components/tab.css +5 -5
  148. package/dist/components/tab.js +25 -7
  149. package/dist/components/tab.min.css +2 -2
  150. package/dist/components/tab.min.js +3 -3
  151. package/dist/components/table.css +1684 -272
  152. package/dist/components/table.min.css +2 -2
  153. package/dist/components/text.css +1 -1
  154. package/dist/components/text.min.css +1 -1
  155. package/dist/components/toast.css +43 -1
  156. package/dist/components/toast.js +68 -34
  157. package/dist/components/toast.min.css +2 -2
  158. package/dist/components/toast.min.js +3 -3
  159. package/dist/components/transition.css +1 -1
  160. package/dist/components/transition.js +27 -22
  161. package/dist/components/transition.min.css +1 -1
  162. package/dist/components/transition.min.js +3 -3
  163. package/dist/components/visibility.js +5 -5
  164. package/dist/components/visibility.min.js +3 -3
  165. package/dist/semantic.css +42008 -34578
  166. package/dist/semantic.js +2719 -763
  167. package/dist/semantic.min.css +3 -3
  168. package/dist/semantic.min.js +3 -3
  169. package/dist/themes/default/assets/fonts/Lato-Bold.woff +0 -0
  170. package/dist/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
  171. package/dist/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
  172. package/dist/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  173. package/dist/themes/default/assets/fonts/Lato-Italic.woff +0 -0
  174. package/dist/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
  175. package/dist/themes/default/assets/fonts/Lato-Regular.woff +0 -0
  176. package/dist/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
  177. package/dist/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  178. package/dist/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
  179. package/dist/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
  180. package/dist/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
  181. package/dist/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
  182. package/dist/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
  183. package/dist/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  184. package/dist/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
  185. package/dist/themes/default/assets/fonts/brand-icons.eot +0 -0
  186. package/dist/themes/default/assets/fonts/brand-icons.svg +801 -654
  187. package/dist/themes/default/assets/fonts/brand-icons.ttf +0 -0
  188. package/dist/themes/default/assets/fonts/brand-icons.woff +0 -0
  189. package/dist/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  190. package/dist/themes/default/assets/fonts/icons.eot +0 -0
  191. package/dist/themes/default/assets/fonts/icons.svg +1175 -1079
  192. package/dist/themes/default/assets/fonts/icons.ttf +0 -0
  193. package/dist/themes/default/assets/fonts/icons.woff +0 -0
  194. package/dist/themes/default/assets/fonts/icons.woff2 +0 -0
  195. package/dist/themes/default/assets/fonts/outline-icons.eot +0 -0
  196. package/dist/themes/default/assets/fonts/outline-icons.svg +93 -95
  197. package/dist/themes/default/assets/fonts/outline-icons.ttf +0 -0
  198. package/dist/themes/default/assets/fonts/outline-icons.woff +0 -0
  199. package/dist/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  200. package/dist/themes/{default → famfamfam}/assets/images/flags.png +0 -0
  201. package/examples/assets/library/iframe-content.js +8 -8
  202. package/examples/assets/library/iframe.js +3 -3
  203. package/examples/components/button.html +1 -1
  204. package/examples/components/card.html +1 -1
  205. package/examples/components/input.html +1 -1
  206. package/examples/components/menu.html +1 -1
  207. package/examples/components/site.html +1 -1
  208. package/examples/components/table.html +1 -1
  209. package/package.json +18 -16
  210. package/scripts/nightly-version.js +47 -38
  211. package/src/definitions/behaviors/api.js +91 -32
  212. package/src/definitions/behaviors/form.js +45 -41
  213. package/src/definitions/behaviors/state.js +2 -2
  214. package/src/definitions/behaviors/visibility.js +4 -4
  215. package/src/definitions/collections/form.less +229 -166
  216. package/src/definitions/collections/grid.less +723 -687
  217. package/src/definitions/collections/menu.less +232 -170
  218. package/src/definitions/collections/message.less +49 -47
  219. package/src/definitions/collections/table.less +882 -272
  220. package/src/definitions/elements/button.less +611 -469
  221. package/src/definitions/elements/container.less +145 -8
  222. package/src/definitions/elements/divider.less +24 -24
  223. package/src/definitions/elements/emoji.less +39 -10
  224. package/src/definitions/elements/flag.less +54 -18
  225. package/src/definitions/elements/header.less +46 -37
  226. package/src/definitions/elements/icon.less +39 -32
  227. package/src/definitions/elements/input.less +281 -33
  228. package/src/definitions/elements/label.less +132 -128
  229. package/src/definitions/elements/list.less +84 -75
  230. package/src/definitions/elements/loader.less +99 -98
  231. package/src/definitions/elements/placeholder.less +32 -32
  232. package/src/definitions/elements/segment.less +177 -56
  233. package/src/definitions/elements/step.less +76 -72
  234. package/src/definitions/elements/text.less +17 -15
  235. package/src/definitions/globals/reset.less +2 -2
  236. package/src/definitions/globals/site.js +1 -1
  237. package/src/definitions/globals/site.less +25 -2
  238. package/src/definitions/modules/accordion.js +9 -3
  239. package/src/definitions/modules/accordion.less +371 -219
  240. package/src/definitions/modules/calendar.js +92 -73
  241. package/src/definitions/modules/calendar.less +20 -0
  242. package/src/definitions/modules/checkbox.js +20 -13
  243. package/src/definitions/modules/checkbox.less +83 -227
  244. package/src/definitions/modules/dimmer.js +18 -9
  245. package/src/definitions/modules/dimmer.less +26 -12
  246. package/src/definitions/modules/dropdown.js +211 -186
  247. package/src/definitions/modules/dropdown.less +201 -136
  248. package/src/definitions/modules/embed.js +13 -9
  249. package/src/definitions/modules/embed.less +4 -4
  250. package/src/definitions/modules/flyout.js +1529 -0
  251. package/src/definitions/modules/flyout.less +650 -0
  252. package/src/definitions/modules/modal.js +186 -83
  253. package/src/definitions/modules/modal.less +70 -33
  254. package/src/definitions/modules/nag.js +2 -2
  255. package/src/definitions/modules/nag.less +20 -19
  256. package/src/definitions/modules/popup.js +16 -22
  257. package/src/definitions/modules/popup.less +86 -90
  258. package/src/definitions/modules/progress.js +5 -2
  259. package/src/definitions/modules/progress.less +19 -18
  260. package/src/definitions/modules/rating.js +7 -3
  261. package/src/definitions/modules/rating.less +35 -34
  262. package/src/definitions/modules/search.js +47 -20
  263. package/src/definitions/modules/search.less +35 -19
  264. package/src/definitions/modules/shape.js +3 -3
  265. package/src/definitions/modules/sidebar.js +140 -43
  266. package/src/definitions/modules/sidebar.less +53 -24
  267. package/src/definitions/modules/slider.js +78 -63
  268. package/src/definitions/modules/slider.less +48 -47
  269. package/src/definitions/modules/sticky.js +10 -17
  270. package/src/definitions/modules/sticky.less +3 -1
  271. package/src/definitions/modules/tab.js +24 -6
  272. package/src/definitions/modules/tab.less +4 -4
  273. package/src/definitions/modules/toast.js +67 -33
  274. package/src/definitions/modules/toast.less +52 -16
  275. package/src/definitions/modules/transition.js +26 -21
  276. package/src/definitions/views/ad.less +3 -3
  277. package/src/definitions/views/card.less +522 -375
  278. package/src/definitions/views/comment.less +93 -82
  279. package/src/definitions/views/feed.less +164 -144
  280. package/src/definitions/views/item.less +251 -198
  281. package/src/definitions/views/statistic.less +91 -89
  282. package/src/semantic.less +1 -0
  283. package/src/theme.config.example +1 -0
  284. package/src/theme.less +13 -2
  285. package/src/themes/amazon/globals/site.variables +1 -0
  286. package/src/themes/basic/elements/icon.overrides +149 -149
  287. package/src/themes/basic/elements/step.overrides +2 -2
  288. package/src/themes/bookish/elements/header.overrides +1 -1
  289. package/src/themes/chubby/elements/button.overrides +1 -1
  290. package/src/themes/chubby/elements/header.overrides +1 -1
  291. package/src/themes/default/assets/fonts/Lato-Bold.woff +0 -0
  292. package/src/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
  293. package/src/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
  294. package/src/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  295. package/src/themes/default/assets/fonts/Lato-Italic.woff +0 -0
  296. package/src/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
  297. package/src/themes/default/assets/fonts/Lato-Regular.woff +0 -0
  298. package/src/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
  299. package/src/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  300. package/src/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
  301. package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
  302. package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
  303. package/src/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
  304. package/src/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
  305. package/src/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  306. package/src/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
  307. package/src/themes/default/assets/fonts/brand-icons.eot +0 -0
  308. package/src/themes/default/assets/fonts/brand-icons.svg +801 -654
  309. package/src/themes/default/assets/fonts/brand-icons.ttf +0 -0
  310. package/src/themes/default/assets/fonts/brand-icons.woff +0 -0
  311. package/src/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  312. package/src/themes/default/assets/fonts/icons.eot +0 -0
  313. package/src/themes/default/assets/fonts/icons.svg +1175 -1079
  314. package/src/themes/default/assets/fonts/icons.ttf +0 -0
  315. package/src/themes/default/assets/fonts/icons.woff +0 -0
  316. package/src/themes/default/assets/fonts/icons.woff2 +0 -0
  317. package/src/themes/default/assets/fonts/outline-icons.eot +0 -0
  318. package/src/themes/default/assets/fonts/outline-icons.svg +93 -95
  319. package/src/themes/default/assets/fonts/outline-icons.ttf +0 -0
  320. package/src/themes/default/assets/fonts/outline-icons.woff +0 -0
  321. package/src/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  322. package/src/themes/default/collections/form.variables +4 -0
  323. package/src/themes/default/collections/menu.variables +6 -0
  324. package/src/themes/default/collections/table.variables +52 -0
  325. package/src/themes/default/elements/button.variables +7 -1
  326. package/src/themes/default/elements/container.variables +12 -0
  327. package/src/themes/default/elements/divider.overrides +7 -7
  328. package/src/themes/default/elements/emoji.overrides +0 -3090
  329. package/src/themes/default/elements/emoji.variables +3563 -1
  330. package/src/themes/default/elements/flag.overrides +0 -991
  331. package/src/themes/default/elements/flag.variables +1603 -5
  332. package/src/themes/default/elements/icon.overrides +1975 -1949
  333. package/src/themes/default/elements/icon.variables +1 -0
  334. package/src/themes/default/elements/input.variables +15 -0
  335. package/src/themes/default/elements/segment.variables +8 -0
  336. package/src/themes/default/elements/step.overrides +3 -3
  337. package/src/themes/default/globals/site.variables +109 -8
  338. package/src/themes/default/globals/variation.variables +161 -6
  339. package/src/themes/default/modules/accordion.overrides +6 -5
  340. package/src/themes/default/modules/accordion.variables +49 -2
  341. package/src/themes/default/modules/calendar.variables +3 -0
  342. package/src/themes/default/modules/checkbox.overrides +9 -9
  343. package/src/themes/default/modules/checkbox.variables +5 -5
  344. package/src/themes/default/modules/dimmer.variables +1 -1
  345. package/src/themes/default/modules/dropdown.overrides +5 -5
  346. package/src/themes/default/modules/dropdown.variables +7 -10
  347. package/src/themes/default/modules/flyout.overrides +3 -0
  348. package/src/themes/default/modules/flyout.variables +100 -0
  349. package/src/themes/default/modules/modal.variables +16 -2
  350. package/src/themes/default/modules/popup.variables +0 -2
  351. package/src/themes/default/modules/sidebar.variables +4 -1
  352. package/src/themes/default/modules/toast.variables +3 -0
  353. package/src/themes/default/views/card.variables +8 -0
  354. package/src/themes/{default → famfamfam}/assets/images/flags.png +0 -0
  355. package/src/themes/famfamfam/elements/flag.overrides +1026 -0
  356. package/src/themes/famfamfam/elements/flag.variables +20 -0
  357. package/src/themes/github/elements/icon.overrides +206 -206
  358. package/src/themes/github/elements/step.overrides +5 -5
  359. package/src/themes/github/globals/site.variables +1 -0
  360. package/src/themes/github/modules/dropdown.overrides +6 -6
  361. package/src/themes/instagram/views/card.overrides +1 -1
  362. package/src/themes/joypixels/elements/emoji.overrides +0 -3089
  363. package/src/themes/joypixels/elements/emoji.variables +3562 -5
  364. package/src/themes/material/collections/menu.overrides +1 -1
  365. package/src/themes/material/elements/button.overrides +1 -1
  366. package/src/themes/material/elements/header.overrides +1 -1
  367. package/src/themes/material/elements/icon.overrides +932 -932
  368. package/src/themes/material/globals/site.variables +0 -1
  369. package/src/themes/material/modules/dropdown.overrides +1 -1
  370. package/src/themes/material/modules/modal.overrides +1 -1
  371. package/src/themes/pulsar/elements/loader.overrides +2 -2
  372. package/src/themes/resetcss/globals/reset.overrides +3 -3
  373. package/src/themes/rtl/globals/site.overrides +1 -1
  374. package/src/themes/striped/modules/progress.overrides +1 -1
  375. package/src/themes/systemfont/globals/reset.overrides +8 -0
  376. package/src/themes/systemfont/globals/site.variables +10 -0
  377. package/src/themes/twitter/elements/emoji.overrides +0 -3091
  378. package/src/themes/twitter/elements/emoji.variables +3558 -6
  379. package/tasks/admin/distributions/create.js +1 -1
  380. package/tasks/admin/publish.js +1 -1
  381. package/tasks/admin/release.js +1 -1
  382. package/tasks/build/assets.js +1 -1
  383. package/tasks/build/css.js +9 -4
  384. package/tasks/build/javascript.js +3 -3
  385. package/tasks/check-install.js +1 -1
  386. package/tasks/clean.js +1 -1
  387. package/tasks/collections/README.md +1 -1
  388. package/tasks/collections/admin.js +1 -1
  389. package/tasks/config/admin/oauth.example.js +1 -1
  390. package/tasks/config/admin/release.js +1 -0
  391. package/tasks/config/admin/templates/composer.json +1 -1
  392. package/tasks/config/defaults.js +1 -0
  393. package/tasks/config/project/install.js +16 -13
  394. package/tasks/install.js +1 -0
  395. package/tasks/rtl/watch.js +1 -1
  396. package/tasks/version.js +1 -1
  397. package/test/fixtures/accordion.html +1 -1
  398. package/test/fixtures/checkbox.html +1 -1
  399. package/test/fixtures/dropdown.html +1 -1
  400. package/test/fixtures/modal.html +1 -1
  401. package/test/fixtures/popup.html +1 -1
  402. package/test/fixtures/rating.html +1 -1
  403. package/test/fixtures/shape.html +1 -1
  404. package/test/fixtures/sidebar.html +1 -1
  405. package/test/fixtures/tab.html +1 -1
  406. package/test/fixtures/transition.html +1 -1
  407. package/test/fixtures/video.html +1 -1
  408. package/test/helpers/jasmine-jquery.js +2 -2
  409. package/test/helpers/jasmine-sinon.js +1 -1
  410. package/test/helpers/jquery-events.js +1 -1
  411. package/test/helpers/sinon.js +3 -3
  412. package/test/meteor/fonts.js +1 -1
  413. package/test/modules/accordion.spec.js +1 -1
  414. package/test/modules/checkbox.spec.js +1 -1
  415. package/test/modules/dropdown.spec.js +1 -1
  416. package/test/modules/modal.spec.js +1 -1
  417. package/test/modules/module.spec.js +1 -1
  418. package/test/modules/popup.spec.js +1 -1
  419. package/test/modules/search.spec.js +1 -1
  420. package/test/modules/shape.spec.js +1 -1
  421. package/test/modules/sidebar.spec.js +1 -1
  422. package/test/modules/tab.spec.js +1 -1
  423. package/test/modules/transition.spec.js +1 -1
  424. package/test/modules/video.spec.js +1 -1
@@ -23,7 +23,7 @@ window = (typeof window != 'undefined' && window.Math == Math)
23
23
  : Function('return this')()
24
24
  ;
25
25
 
26
- $.fn.modal = function(parameters) {
26
+ $.modal = $.fn.modal = function(parameters) {
27
27
  var
28
28
  $allModules = $(this),
29
29
  $window = $(window),
@@ -65,8 +65,10 @@ $.fn.modal = function(parameters) {
65
65
  moduleNamespace = 'module-' + namespace,
66
66
 
67
67
  $module = $(this),
68
- $context = $(settings.context),
69
- $close = $module.find(selector.close),
68
+ $context = [window,document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $body,
69
+ isBody = $context[0] === $body[0],
70
+ $closeIcon = $module.find(selector.closeIcon),
71
+ $inputs,
70
72
 
71
73
  $allModals,
72
74
  $otherModals,
@@ -74,8 +76,10 @@ $.fn.modal = function(parameters) {
74
76
  $dimmable,
75
77
  $dimmer,
76
78
 
79
+ isModalComponent = $module.hasClass('modal'),
80
+
77
81
  element = this,
78
- instance = $module.hasClass('modal') ? $module.data(moduleNamespace) : undefined,
82
+ instance = isModalComponent ? $module.data(moduleNamespace) : undefined,
79
83
 
80
84
  ignoreRepeatedEvents = false,
81
85
 
@@ -83,6 +87,8 @@ $.fn.modal = function(parameters) {
83
87
  initialMouseDownInScrollbar,
84
88
  initialBodyMargin = '',
85
89
  tempBodyMargin = '',
90
+ keepScrollingClass = false,
91
+ hadScrollbar = false,
86
92
 
87
93
  elementEventNamespace,
88
94
  id,
@@ -92,7 +98,8 @@ $.fn.modal = function(parameters) {
92
98
  module = {
93
99
 
94
100
  initialize: function() {
95
- if(!$module.hasClass('modal')) {
101
+ module.create.id();
102
+ if(!isModalComponent) {
96
103
  module.create.modal();
97
104
  if(!$.isFunction(settings.onHidden)) {
98
105
  settings.onHidden = function () {
@@ -116,15 +123,17 @@ $.fn.modal = function(parameters) {
116
123
  $actions.empty();
117
124
  }
118
125
  settings.actions.forEach(function (el) {
119
- var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
126
+ var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
120
127
  text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
121
128
  cls = module.helpers.deQuote(el[fields.class] || ''),
122
129
  click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
123
130
  $actions.append($('<button/>', {
124
131
  html: icon + text,
132
+ 'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g,''),
125
133
  class: className.button + ' ' + cls,
126
134
  click: function () {
127
- if (click.call(element, $module) === false) {
135
+ var button = $(this);
136
+ if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
128
137
  return;
129
138
  }
130
139
  module.hide();
@@ -135,7 +144,6 @@ $.fn.modal = function(parameters) {
135
144
  module.cache = {};
136
145
  module.verbose('Initializing dimmer', $context);
137
146
 
138
- module.create.id();
139
147
  module.create.dimmer();
140
148
 
141
149
  if ( settings.allowMultiple ) {
@@ -145,11 +153,9 @@ $.fn.modal = function(parameters) {
145
153
  $module.addClass('top aligned');
146
154
  }
147
155
  module.refreshModals();
148
-
156
+ module.refreshInputs();
149
157
  module.bind.events();
150
- if(settings.observeChanges) {
151
- module.observeChanges();
152
- }
158
+ module.observeChanges();
153
159
  module.instantiate();
154
160
  if(settings.autoShow){
155
161
  module.show();
@@ -166,16 +172,20 @@ $.fn.modal = function(parameters) {
166
172
 
167
173
  create: {
168
174
  modal: function() {
169
- $module = $('<div/>', {class: className.modal});
175
+ $module = $('<div/>', {class: className.modal, role: 'dialog', 'aria-modal': true});
170
176
  if (settings.closeIcon) {
171
- $close = $('<i/>', {class: className.close})
172
- $module.append($close);
177
+ $closeIcon = $('<i/>', {class: className.close, role: 'button', tabindex: 0, 'aria-label': settings.text.close})
178
+ $module.append($closeIcon);
173
179
  }
174
180
  if (settings.title !== '') {
175
- $('<div/>', {class: className.title}).appendTo($module);
181
+ var titleId = '_' + module.get.id() + 'title';
182
+ $module.attr('aria-labelledby', titleId);
183
+ $('<div/>', {class: className.title, id: titleId}).appendTo($module);
176
184
  }
177
185
  if (settings.content !== '') {
178
- $('<div/>', {class: className.content}).appendTo($module);
186
+ var descId = '_' + module.get.id() + 'desc';
187
+ $module.attr('aria-describedby', descId);
188
+ $('<div/>', {class: className.content, id: descId}).appendTo($module);
179
189
  }
180
190
  if (module.has.configActions()) {
181
191
  $('<div/>', {class: className.actions}).appendTo($module);
@@ -196,6 +206,7 @@ $.fn.modal = function(parameters) {
196
206
  }
197
207
  module.debug('Creating dimmer');
198
208
  $dimmable = $context.dimmer(dimmerSettings);
209
+ keepScrollingClass = module.is.scrolling();
199
210
  if(settings.detachable) {
200
211
  module.verbose('Modal is detachable, moving content into dimmer');
201
212
  $dimmable.dimmer('add content', $module);
@@ -206,13 +217,13 @@ $.fn.modal = function(parameters) {
206
217
  $dimmer = $dimmable.dimmer('get dimmer');
207
218
  },
208
219
  id: function() {
209
- id = (Math.random().toString(16) + '000000000').substr(2, 8);
220
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
210
221
  elementEventNamespace = '.' + id;
211
222
  module.verbose('Creating unique id for element', id);
212
223
  },
213
224
  innerDimmer: function() {
214
- if ( $module.find(selector.dimmer).length == 0 ) {
215
- $module.prepend('<div class="ui inverted dimmer"></div>');
225
+ if ( $module.find(selector.dimmer).length === 0 ) {
226
+ $('<div/>', {class: className.innerDimmer}).prependTo($module);
216
227
  }
217
228
  }
218
229
  },
@@ -228,15 +239,21 @@ $.fn.modal = function(parameters) {
228
239
  ;
229
240
  $window.off(elementEventNamespace);
230
241
  $dimmer.off(elementEventNamespace);
231
- $close.off(eventNamespace);
242
+ $closeIcon.off(elementEventNamespace);
243
+ if($inputs) {
244
+ $inputs.off(elementEventNamespace);
245
+ }
232
246
  $context.dimmer('destroy');
233
247
  },
234
248
 
235
249
  observeChanges: function() {
236
250
  if('MutationObserver' in window) {
237
251
  observer = new MutationObserver(function(mutations) {
238
- module.debug('DOM tree modified, refreshing');
239
- module.refresh();
252
+ if(settings.observeChanges) {
253
+ module.debug('DOM tree modified, refreshing');
254
+ module.refresh();
255
+ }
256
+ module.refreshInputs();
240
257
  });
241
258
  observer.observe(element, {
242
259
  childList : true,
@@ -261,6 +278,23 @@ $.fn.modal = function(parameters) {
261
278
  $allModals = $otherModals.add($module);
262
279
  },
263
280
 
281
+ refreshInputs: function(){
282
+ if($inputs){
283
+ $inputs
284
+ .off('keydown' + elementEventNamespace)
285
+ ;
286
+ }
287
+ $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
288
+ return $(this).closest('.disabled').length === 0;
289
+ });
290
+ $inputs.first()
291
+ .on('keydown' + elementEventNamespace, module.event.inputKeyDown.first)
292
+ ;
293
+ $inputs.last()
294
+ .on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
295
+ ;
296
+ },
297
+
264
298
  attachEvents: function(selector, event) {
265
299
  var
266
300
  $toggle = $(selector)
@@ -289,25 +323,28 @@ $.fn.modal = function(parameters) {
289
323
  .on('click' + eventNamespace, selector.approve, module.event.approve)
290
324
  .on('click' + eventNamespace, selector.deny, module.event.deny)
291
325
  ;
326
+ $closeIcon
327
+ .on('keyup' + elementEventNamespace, module.event.closeKeyUp)
328
+ ;
292
329
  $window
293
330
  .on('resize' + elementEventNamespace, module.event.resize)
294
331
  ;
295
332
  },
296
333
  scrollLock: function() {
297
334
  // touch events default to passive, due to changes in chrome to optimize mobile perf
298
- $dimmable.get(0).addEventListener('touchmove', module.event.preventScroll, { passive: false });
335
+ $dimmable[0].addEventListener('touchmove', module.event.preventScroll, { passive: false });
299
336
  }
300
337
  },
301
338
 
302
339
  unbind: {
303
340
  scrollLock: function() {
304
- $dimmable.get(0).removeEventListener('touchmove', module.event.preventScroll, { passive: false });
341
+ $dimmable[0].removeEventListener('touchmove', module.event.preventScroll, { passive: false });
305
342
  }
306
343
  },
307
344
 
308
345
  get: {
309
346
  id: function() {
310
- return (Math.random().toString(16) + '000000000').substr(2, 8);
347
+ return id;
311
348
  },
312
349
  element: function() {
313
350
  return $module;
@@ -346,16 +383,44 @@ $.fn.modal = function(parameters) {
346
383
  close: function() {
347
384
  module.hide();
348
385
  },
386
+ closeKeyUp: function(event){
387
+ var
388
+ keyCode = event.which
389
+ ;
390
+ if ((keyCode === settings.keys.enter || keyCode === settings.keys.space) && $module.hasClass(className.front)) {
391
+ module.hide();
392
+ }
393
+ },
394
+ inputKeyDown: {
395
+ first: function(event) {
396
+ var
397
+ keyCode = event.which
398
+ ;
399
+ if (keyCode === settings.keys.tab && event.shiftKey) {
400
+ $inputs.last().focus();
401
+ event.preventDefault();
402
+ }
403
+ },
404
+ last: function(event) {
405
+ var
406
+ keyCode = event.which
407
+ ;
408
+ if (keyCode === settings.keys.tab && !event.shiftKey) {
409
+ $inputs.first().focus();
410
+ event.preventDefault();
411
+ }
412
+ }
413
+ },
349
414
  mousedown: function(event) {
350
415
  var
351
416
  $target = $(event.target),
352
- isRtl = module.is.rtl();
417
+ isRtl = module.is.rtl()
353
418
  ;
354
419
  initialMouseDownInModal = ($target.closest(selector.modal).length > 0);
355
420
  if(initialMouseDownInModal) {
356
421
  module.verbose('Mouse down event registered inside the modal');
357
422
  }
358
- initialMouseDownInScrollbar = module.is.scrolling() && ((!isRtl && $(window).outerWidth() - settings.scrollbarWidth <= event.clientX) || (isRtl && settings.scrollbarWidth >= event.clientX));
423
+ initialMouseDownInScrollbar = module.is.scrolling() && ((!isRtl && $window.outerWidth() - settings.scrollbarWidth <= event.clientX) || (isRtl && settings.scrollbarWidth >= event.clientX));
359
424
  if(initialMouseDownInScrollbar) {
360
425
  module.verbose('Mouse down event registered inside the scrollbar');
361
426
  }
@@ -397,10 +462,9 @@ $.fn.modal = function(parameters) {
397
462
  },
398
463
  keyboard: function(event) {
399
464
  var
400
- keyCode = event.which,
401
- escapeKey = 27
465
+ keyCode = event.which
402
466
  ;
403
- if(keyCode == escapeKey) {
467
+ if(keyCode === settings.keys.escape) {
404
468
  if(settings.closable) {
405
469
  module.debug('Escape key pressed hiding modal');
406
470
  if ( $module.hasClass(className.front) ) {
@@ -456,9 +520,16 @@ $.fn.modal = function(parameters) {
456
520
  : function(){}
457
521
  ;
458
522
  if( module.is.animating() || !module.is.active() ) {
523
+ if(settings.onShow.call(element) === false) {
524
+ module.verbose('Show callback returned false cancelling show');
525
+ return;
526
+ }
527
+ hadScrollbar = module.has.scrollbar();
459
528
  module.showDimmer();
460
529
  module.cacheSizes();
461
- module.set.bodyMargin();
530
+ if(hadScrollbar) {
531
+ module.set.bodyMargin();
532
+ }
462
533
  if(module.can.useFlex()) {
463
534
  module.remove.legacy();
464
535
  }
@@ -485,12 +556,13 @@ $.fn.modal = function(parameters) {
485
556
  $module.detach().appendTo($dimmer);
486
557
  }
487
558
  }
488
- settings.onShow.call(element);
489
559
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
490
560
  module.debug('Showing modal with css animations');
491
561
  $module
492
562
  .transition({
493
563
  debug : settings.debug,
564
+ verbose : settings.verbose,
565
+ silent : settings.silent,
494
566
  animation : (settings.transition.showMethod || settings.transition) + ' in',
495
567
  queue : settings.queue,
496
568
  duration : settings.transition.showDuration || settings.duration,
@@ -528,7 +600,6 @@ $.fn.modal = function(parameters) {
528
600
  ? callback
529
601
  : function(){}
530
602
  ;
531
- module.debug('Hiding modal');
532
603
  if(settings.onHide.call(element, $(this)) === false) {
533
604
  module.verbose('Hide callback returned false cancelling hide');
534
605
  ignoreRepeatedEvents = false;
@@ -536,11 +607,14 @@ $.fn.modal = function(parameters) {
536
607
  }
537
608
 
538
609
  if( module.is.animating() || module.is.active() ) {
610
+ module.debug('Hiding modal');
539
611
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
540
612
  module.remove.active();
541
613
  $module
542
614
  .transition({
543
615
  debug : settings.debug,
616
+ verbose : settings.verbose,
617
+ silent : settings.silent,
544
618
  animation : (settings.transition.hideMethod || settings.transition) + ' out',
545
619
  queue : settings.queue,
546
620
  duration : settings.transition.hideDuration || settings.duration,
@@ -584,7 +658,12 @@ $.fn.modal = function(parameters) {
584
658
 
585
659
  showDimmer: function() {
586
660
  if($dimmable.dimmer('is animating') || !$dimmable.dimmer('is active') ) {
587
- module.save.bodyMargin();
661
+ if(hadScrollbar) {
662
+ if(!isBody) {
663
+ $dimmer.css('top', $dimmable.scrollTop());
664
+ }
665
+ module.save.bodyMargin();
666
+ }
588
667
  module.debug('Showing dimmer');
589
668
  $dimmable.dimmer('show');
590
669
  }
@@ -597,14 +676,15 @@ $.fn.modal = function(parameters) {
597
676
  if( $dimmable.dimmer('is animating') || ($dimmable.dimmer('is active')) ) {
598
677
  module.unbind.scrollLock();
599
678
  $dimmable.dimmer('hide', function() {
600
- module.restore.bodyMargin();
679
+ if(hadScrollbar) {
680
+ module.restore.bodyMargin();
681
+ }
601
682
  module.remove.clickaway();
602
683
  module.remove.screenHeight();
603
684
  });
604
685
  }
605
686
  else {
606
687
  module.debug('Dimmer is not visible cannot hide');
607
- return;
608
688
  }
609
689
  },
610
690
 
@@ -662,7 +742,7 @@ $.fn.modal = function(parameters) {
662
742
  keyboardShortcuts: function() {
663
743
  module.verbose('Adding keyboard shortcuts');
664
744
  $document
665
- .on('keyup' + eventNamespace, module.event.keyboard)
745
+ .on('keydown' + eventNamespace, module.event.keyboard)
666
746
  ;
667
747
  }
668
748
  },
@@ -678,9 +758,9 @@ $.fn.modal = function(parameters) {
678
758
  }
679
759
  },
680
760
  bodyMargin: function() {
681
- initialBodyMargin = $body.css('margin-'+(module.can.leftBodyScrollbar() ? 'left':'right'));
761
+ initialBodyMargin = $context.css((isBody ? 'margin-':'padding-')+(module.can.leftBodyScrollbar() ? 'left':'right'));
682
762
  var bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, '')),
683
- bodyScrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
763
+ bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
684
764
  tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
685
765
  }
686
766
  },
@@ -693,8 +773,8 @@ $.fn.modal = function(parameters) {
693
773
  },
694
774
  bodyMargin: function() {
695
775
  var position = module.can.leftBodyScrollbar() ? 'left':'right';
696
- $body.css('margin-'+position, initialBodyMargin);
697
- $body.find(selector.bodyFixed.replace('right',position)).each(function(){
776
+ $context.css((isBody ? 'margin-':'padding-')+position, initialBodyMargin);
777
+ $context.find(selector.bodyFixed.replace('right',position)).each(function(){
698
778
  var el = $(this),
699
779
  attribute = el.css('position') === 'fixed' ? 'padding-'+position : position
700
780
  ;
@@ -715,7 +795,7 @@ $.fn.modal = function(parameters) {
715
795
  $module
716
796
  .off('mousedown' + elementEventNamespace)
717
797
  ;
718
- }
798
+ }
719
799
  $dimmer
720
800
  .off('mousedown' + elementEventNamespace)
721
801
  ;
@@ -728,25 +808,28 @@ $.fn.modal = function(parameters) {
728
808
  $dimmable.removeClass(className.blurring);
729
809
  },
730
810
  bodyStyle: function() {
731
- if($body.attr('style') === '') {
811
+ if($context.attr('style') === '') {
732
812
  module.verbose('Removing style attribute');
733
- $body.removeAttr('style');
813
+ $context.removeAttr('style');
734
814
  }
735
815
  },
736
816
  screenHeight: function() {
737
817
  module.debug('Removing page height');
738
- $body
818
+ $context
739
819
  .css('height', '')
740
820
  ;
821
+ module.remove.bodyStyle()
741
822
  },
742
823
  keyboardShortcuts: function() {
743
824
  module.verbose('Removing keyboard shortcuts');
744
825
  $document
745
- .off('keyup' + eventNamespace)
826
+ .off('keydown' + eventNamespace)
746
827
  ;
747
828
  },
748
829
  scrolling: function() {
749
- $dimmable.removeClass(className.scrolling);
830
+ if(!keepScrollingClass) {
831
+ $dimmable.removeClass(className.scrolling);
832
+ }
750
833
  $module.removeClass(className.scrolling);
751
834
  }
752
835
  },
@@ -760,12 +843,12 @@ $.fn.modal = function(parameters) {
760
843
  ;
761
844
  if(module.cache.pageHeight === undefined || modalHeight !== 0) {
762
845
  $.extend(module.cache, {
763
- pageHeight : $(document).outerHeight(),
846
+ pageHeight : $document.outerHeight(),
764
847
  width : modalWidth,
765
848
  height : modalHeight + settings.offset,
766
849
  scrollHeight : scrollHeight + settings.offset,
767
- contextHeight : (settings.context == 'body')
768
- ? $(window).height()
850
+ contextHeight : isBody
851
+ ? $window.height()
769
852
  : $dimmable.height(),
770
853
  });
771
854
  module.cache.topOffset = -(module.cache.height / 2);
@@ -796,7 +879,7 @@ $.fn.modal = function(parameters) {
796
879
  }
797
880
  ;
798
881
  if(shouldEscape.test(string)) {
799
- string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&amp;");
882
+ string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, "&amp;");
800
883
  return string.replace(badChars, escapedChar);
801
884
  }
802
885
  return string;
@@ -839,6 +922,9 @@ $.fn.modal = function(parameters) {
839
922
  has: {
840
923
  configActions: function () {
841
924
  return Array.isArray(settings.actions) && settings.actions.length > 0;
925
+ },
926
+ scrollbar: function() {
927
+ return isBody || $context.css('overflow-y') !== 'hidden';
842
928
  }
843
929
  },
844
930
  is: {
@@ -870,7 +956,7 @@ $.fn.modal = function(parameters) {
870
956
  },
871
957
  rtl: function() {
872
958
  if(module.cache.isRTL === undefined) {
873
- module.cache.isRTL = $body.attr('dir') === 'rtl' || $body.css('direction') === 'rtl';
959
+ module.cache.isRTL = $module.attr('dir') === 'rtl' || $module.css('direction') === 'rtl' || $body.attr('dir') === 'rtl' || $body.css('direction') === 'rtl' || $context.attr('dir') === 'rtl' || $context.css('direction') === 'rtl';
874
960
  }
875
961
  return module.cache.isRTL;
876
962
  },
@@ -900,13 +986,10 @@ $.fn.modal = function(parameters) {
900
986
  set: {
901
987
  autofocus: function() {
902
988
  var
903
- $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
904
- return $(this).closest('.disabled').length === 0;
905
- }),
906
989
  $autofocus = $inputs.filter('[autofocus]'),
907
990
  $input = ($autofocus.length > 0)
908
991
  ? $autofocus.first()
909
- : $inputs.first()
992
+ : ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
910
993
  ;
911
994
  if($input.length > 0) {
912
995
  $input.focus();
@@ -915,9 +998,9 @@ $.fn.modal = function(parameters) {
915
998
  bodyMargin: function() {
916
999
  var position = module.can.leftBodyScrollbar() ? 'left':'right';
917
1000
  if(settings.detachable || module.can.fit()) {
918
- $body.css('margin-'+position, tempBodyMargin + 'px');
1001
+ $context.css((isBody ? 'margin-':'padding-')+position, tempBodyMargin + 'px');
919
1002
  }
920
- $body.find(selector.bodyFixed.replace('right',position)).each(function(){
1003
+ $context.find(selector.bodyFixed.replace('right',position)).each(function(){
921
1004
  var el = $(this),
922
1005
  attribute = el.css('position') === 'fixed' ? 'padding-'+position : position
923
1006
  ;
@@ -983,12 +1066,12 @@ $.fn.modal = function(parameters) {
983
1066
  $module
984
1067
  .css({
985
1068
  top: (!$module.hasClass('aligned') && canFit)
986
- ? $(document).scrollTop() + (module.cache.contextHeight - module.cache.height) / 2
1069
+ ? $document.scrollTop() + (module.cache.contextHeight - module.cache.height) / 2
987
1070
  : !canFit || $module.hasClass('top')
988
- ? $(document).scrollTop() + settings.padding
989
- : $(document).scrollTop() + (module.cache.contextHeight - module.cache.height - settings.padding),
1071
+ ? $document.scrollTop() + settings.padding
1072
+ : $document.scrollTop() + (module.cache.contextHeight - module.cache.height - settings.padding),
990
1073
  marginLeft: -(module.cache.width / 2)
991
- })
1074
+ })
992
1075
  ;
993
1076
  } else {
994
1077
  $module
@@ -997,18 +1080,18 @@ $.fn.modal = function(parameters) {
997
1080
  ? -(module.cache.height / 2)
998
1081
  : settings.padding / 2,
999
1082
  marginLeft: -(module.cache.width / 2)
1000
- })
1083
+ })
1001
1084
  ;
1002
1085
  }
1003
1086
  module.verbose('Setting modal offset for legacy mode');
1004
1087
  },
1005
1088
  screenHeight: function() {
1006
1089
  if( module.can.fit() ) {
1007
- $body.css('height', '');
1090
+ $context.css('height', '');
1008
1091
  }
1009
1092
  else if(!$module.hasClass('bottom')) {
1010
1093
  module.debug('Modal is taller than page content, resizing page height');
1011
- $body
1094
+ $context
1012
1095
  .css('height', module.cache.height + (settings.padding * 2) )
1013
1096
  ;
1014
1097
  }
@@ -1160,7 +1243,7 @@ $.fn.modal = function(parameters) {
1160
1243
  response
1161
1244
  ;
1162
1245
  passedArguments = passedArguments || queryArguments;
1163
- context = element || context;
1246
+ context = context || element;
1164
1247
  if(typeof query == 'string' && object !== undefined) {
1165
1248
  query = query.split(/[\. ]/);
1166
1249
  maxDepth = query.length - 1;
@@ -1323,11 +1406,19 @@ $.fn.modal.settings = {
1323
1406
  // called after deny selector match
1324
1407
  onDeny : function(){ return true; },
1325
1408
 
1409
+ keys : {
1410
+ space : 32,
1411
+ enter : 13,
1412
+ escape : 27,
1413
+ tab : 9,
1414
+ },
1415
+
1326
1416
  selector : {
1327
1417
  title : '> .header',
1328
1418
  content : '> .content',
1329
1419
  actions : '> .actions',
1330
1420
  close : '> .close',
1421
+ closeIcon: '> .close',
1331
1422
  approve : '.actions .positive, .actions .approve, .actions .ok',
1332
1423
  deny : '.actions .negative, .actions .deny, .actions .cancel',
1333
1424
  modal : '.ui.modal',
@@ -1359,11 +1450,13 @@ $.fn.modal.settings = {
1359
1450
  template : 'ui tiny modal',
1360
1451
  ok : 'positive',
1361
1452
  cancel : 'negative',
1362
- prompt : 'ui fluid input'
1453
+ prompt : 'ui fluid input',
1454
+ innerDimmer: 'ui inverted dimmer'
1363
1455
  },
1364
1456
  text: {
1365
1457
  ok : 'Ok',
1366
- cancel: 'Cancel'
1458
+ cancel: 'Cancel',
1459
+ close : 'Close'
1367
1460
  }
1368
1461
  };
1369
1462
 
@@ -1389,33 +1482,39 @@ $.fn.modal.settings.templates = {
1389
1482
  },
1390
1483
  alert: function () {
1391
1484
  var settings = this.get.settings(),
1392
- args = settings.templates.getArguments(arguments)
1485
+ args = settings.templates.getArguments(arguments),
1486
+ approveFn = args.handler
1393
1487
  ;
1394
1488
  return {
1395
1489
  title : args.title,
1396
1490
  content: args.content,
1491
+ onApprove: approveFn,
1397
1492
  actions: [{
1398
1493
  text : settings.text.ok,
1399
1494
  class: settings.className.ok,
1400
- click: args.handler
1495
+ click: approveFn
1401
1496
  }]
1402
1497
  }
1403
1498
  },
1404
1499
  confirm: function () {
1405
1500
  var settings = this.get.settings(),
1406
- args = settings.templates.getArguments(arguments)
1501
+ args = settings.templates.getArguments(arguments),
1502
+ approveFn = function(){args.handler(true)},
1503
+ denyFn = function(){args.handler(false)}
1407
1504
  ;
1408
1505
  return {
1409
1506
  title : args.title,
1410
1507
  content: args.content,
1508
+ onApprove: approveFn,
1509
+ onDeny: denyFn,
1411
1510
  actions: [{
1412
1511
  text : settings.text.ok,
1413
1512
  class: settings.className.ok,
1414
- click: function(){args.handler(true)}
1513
+ click: approveFn
1415
1514
  },{
1416
1515
  text: settings.text.cancel,
1417
1516
  class: settings.className.cancel,
1418
- click: function(){args.handler(false)}
1517
+ click: denyFn
1419
1518
  }]
1420
1519
  }
1421
1520
  },
@@ -1423,27 +1522,31 @@ $.fn.modal.settings.templates = {
1423
1522
  var $this = this,
1424
1523
  settings = this.get.settings(),
1425
1524
  args = settings.templates.getArguments(arguments),
1426
- input = $($.parseHTML(args.content)).filter('.ui.input')
1525
+ input = $($.parseHTML(args.content)).filter('.ui.input'),
1526
+ approveFn = function(){
1527
+ var settings = $this.get.settings(),
1528
+ inputField = $this.get.element().find(settings.selector.prompt)[0]
1529
+ ;
1530
+ args.handler($(inputField).val());
1531
+ },
1532
+ denyFn = function(){args.handler(null)}
1427
1533
  ;
1428
1534
  if (input.length === 0) {
1429
- args.content += '<p><div class="'+settings.className.prompt+'"><input placeholder="'+this.helpers.deQuote(args.placeholder || '')+'" type="text" value="'+this.helpers.deQuote(args.defaultValue || '')+'"></div></p>';
1535
+ args.content += '<p><div class="'+this.helpers.deQuote(settings.className.prompt)+'"><input placeholder="'+this.helpers.deQuote(args.placeholder || '')+'" type="text" value="'+this.helpers.deQuote(args.defaultValue || '')+'"></div></p>';
1430
1536
  }
1431
1537
  return {
1432
1538
  title : args.title,
1433
1539
  content: args.content,
1540
+ onApprove: approveFn,
1541
+ onDeny: denyFn,
1434
1542
  actions: [{
1435
1543
  text: settings.text.ok,
1436
1544
  class: settings.className.ok,
1437
- click: function(){
1438
- var settings = $this.get.settings(),
1439
- inputField = $this.get.element().find(settings.selector.prompt)[0]
1440
- ;
1441
- args.handler($(inputField).val());
1442
- }
1545
+ click: approveFn
1443
1546
  },{
1444
1547
  text: settings.text.cancel,
1445
1548
  class: settings.className.cancel,
1446
- click: function(){args.handler(null)}
1549
+ click: denyFn
1447
1550
  }]
1448
1551
  }
1449
1552
  }