fomantic-ui 2.9.0-beta.19 → 2.9.0-beta.190

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 (234) hide show
  1. package/.all-contributorsrc +197 -3
  2. package/CONTRIBUTORS.md +74 -37
  3. package/README.md +1 -1
  4. package/dist/components/accordion.css +50 -6
  5. package/dist/components/accordion.js +1 -1
  6. package/dist/components/accordion.min.css +2 -2
  7. package/dist/components/accordion.min.js +2 -2
  8. package/dist/components/ad.css +1 -1
  9. package/dist/components/ad.min.css +1 -1
  10. package/dist/components/api.js +29 -25
  11. package/dist/components/api.min.js +3 -3
  12. package/dist/components/breadcrumb.css +1 -1
  13. package/dist/components/breadcrumb.min.css +1 -1
  14. package/dist/components/button.css +81 -81
  15. package/dist/components/button.min.css +2 -2
  16. package/dist/components/calendar.css +1 -1
  17. package/dist/components/calendar.js +6 -7
  18. package/dist/components/calendar.min.css +1 -1
  19. package/dist/components/calendar.min.js +3 -3
  20. package/dist/components/card.css +26 -19
  21. package/dist/components/card.min.css +2 -2
  22. package/dist/components/checkbox.css +2 -1
  23. package/dist/components/checkbox.js +17 -11
  24. package/dist/components/checkbox.min.css +2 -2
  25. package/dist/components/checkbox.min.js +3 -3
  26. package/dist/components/comment.css +11 -11
  27. package/dist/components/comment.min.css +1 -1
  28. package/dist/components/container.css +77 -1
  29. package/dist/components/container.min.css +2 -2
  30. package/dist/components/dimmer.css +28 -14
  31. package/dist/components/dimmer.js +1 -1
  32. package/dist/components/dimmer.min.css +2 -2
  33. package/dist/components/dimmer.min.js +2 -2
  34. package/dist/components/divider.css +1 -1
  35. package/dist/components/divider.min.css +1 -1
  36. package/dist/components/dropdown.css +30 -7
  37. package/dist/components/dropdown.js +58 -33
  38. package/dist/components/dropdown.min.css +2 -2
  39. package/dist/components/dropdown.min.js +3 -3
  40. package/dist/components/embed.css +1 -1
  41. package/dist/components/embed.js +1 -1
  42. package/dist/components/embed.min.css +1 -1
  43. package/dist/components/embed.min.js +2 -2
  44. package/dist/components/emoji.css +2 -2
  45. package/dist/components/feed.css +28 -28
  46. package/dist/components/feed.min.css +2 -2
  47. package/dist/components/flag.css +731 -625
  48. package/dist/components/flag.min.css +2 -2
  49. package/dist/components/form.css +106 -55
  50. package/dist/components/form.js +25 -23
  51. package/dist/components/form.min.css +2 -2
  52. package/dist/components/form.min.js +3 -3
  53. package/dist/components/grid.css +11 -8
  54. package/dist/components/grid.min.css +2 -2
  55. package/dist/components/header.css +1 -1
  56. package/dist/components/header.min.css +1 -1
  57. package/dist/components/icon.css +6 -1
  58. package/dist/components/icon.min.css +2 -2
  59. package/dist/components/image.css +1 -1
  60. package/dist/components/image.min.css +1 -1
  61. package/dist/components/input.css +734 -17
  62. package/dist/components/input.min.css +2 -2
  63. package/dist/components/item.css +13 -13
  64. package/dist/components/item.min.css +1 -1
  65. package/dist/components/label.css +1 -1
  66. package/dist/components/label.min.css +1 -1
  67. package/dist/components/list.css +1 -1
  68. package/dist/components/list.min.css +1 -1
  69. package/dist/components/loader.css +1 -1
  70. package/dist/components/loader.min.css +1 -1
  71. package/dist/components/menu.css +29 -5
  72. package/dist/components/menu.min.css +1 -1
  73. package/dist/components/message.css +41 -41
  74. package/dist/components/message.min.css +2 -2
  75. package/dist/components/modal.css +3 -1
  76. package/dist/components/modal.js +117 -43
  77. package/dist/components/modal.min.css +2 -2
  78. package/dist/components/modal.min.js +3 -3
  79. package/dist/components/nag.css +1 -1
  80. package/dist/components/nag.js +1 -1
  81. package/dist/components/nag.min.css +1 -1
  82. package/dist/components/nag.min.js +2 -2
  83. package/dist/components/placeholder.css +1 -1
  84. package/dist/components/placeholder.min.css +1 -1
  85. package/dist/components/popup.css +5 -3
  86. package/dist/components/popup.js +1 -1
  87. package/dist/components/popup.min.css +2 -2
  88. package/dist/components/popup.min.js +2 -2
  89. package/dist/components/progress.css +1 -1
  90. package/dist/components/progress.js +4 -1
  91. package/dist/components/progress.min.css +1 -1
  92. package/dist/components/progress.min.js +3 -3
  93. package/dist/components/rail.css +1 -1
  94. package/dist/components/rail.min.css +1 -1
  95. package/dist/components/rating.css +7 -46
  96. package/dist/components/rating.js +1 -1
  97. package/dist/components/rating.min.css +2 -2
  98. package/dist/components/rating.min.js +2 -2
  99. package/dist/components/reset.css +1 -1
  100. package/dist/components/reset.min.css +1 -1
  101. package/dist/components/reveal.css +1 -1
  102. package/dist/components/reveal.min.css +1 -1
  103. package/dist/components/search.css +1 -1
  104. package/dist/components/search.js +1 -1
  105. package/dist/components/search.min.css +1 -1
  106. package/dist/components/search.min.js +2 -2
  107. package/dist/components/segment.css +90 -6
  108. package/dist/components/segment.min.css +2 -2
  109. package/dist/components/shape.css +1 -1
  110. package/dist/components/shape.js +1 -1
  111. package/dist/components/shape.min.css +1 -1
  112. package/dist/components/shape.min.js +2 -2
  113. package/dist/components/sidebar.css +4 -2
  114. package/dist/components/sidebar.js +1 -1
  115. package/dist/components/sidebar.min.css +2 -2
  116. package/dist/components/sidebar.min.js +2 -2
  117. package/dist/components/site.css +61 -39
  118. package/dist/components/site.js +1 -1
  119. package/dist/components/site.min.css +2 -2
  120. package/dist/components/site.min.js +2 -2
  121. package/dist/components/slider.js +1 -1
  122. package/dist/components/slider.min.js +2 -2
  123. package/dist/components/state.js +1 -1
  124. package/dist/components/state.min.js +2 -2
  125. package/dist/components/statistic.css +1 -1
  126. package/dist/components/statistic.min.css +1 -1
  127. package/dist/components/step.css +4 -4
  128. package/dist/components/step.min.css +2 -2
  129. package/dist/components/sticky.css +1 -1
  130. package/dist/components/sticky.js +1 -1
  131. package/dist/components/sticky.min.css +1 -1
  132. package/dist/components/sticky.min.js +2 -2
  133. package/dist/components/tab.css +1 -1
  134. package/dist/components/tab.js +23 -5
  135. package/dist/components/tab.min.css +1 -1
  136. package/dist/components/tab.min.js +3 -3
  137. package/dist/components/table.css +1168 -26
  138. package/dist/components/table.min.css +2 -2
  139. package/dist/components/text.css +1 -1
  140. package/dist/components/text.min.css +1 -1
  141. package/dist/components/toast.css +39 -1
  142. package/dist/components/toast.js +54 -27
  143. package/dist/components/toast.min.css +2 -2
  144. package/dist/components/toast.min.js +3 -3
  145. package/dist/components/transition.css +1 -1
  146. package/dist/components/transition.js +1 -1
  147. package/dist/components/transition.min.css +1 -1
  148. package/dist/components/transition.min.js +2 -2
  149. package/dist/components/visibility.js +1 -1
  150. package/dist/components/visibility.min.js +2 -2
  151. package/dist/semantic.css +4082 -1304
  152. package/dist/semantic.js +350 -192
  153. package/dist/semantic.min.css +3 -3
  154. package/dist/semantic.min.js +3 -3
  155. package/examples/assets/library/iframe-content.js +5 -5
  156. package/package.json +2 -2
  157. package/src/definitions/behaviors/api.js +28 -24
  158. package/src/definitions/behaviors/form.js +24 -22
  159. package/src/definitions/collections/form.less +193 -140
  160. package/src/definitions/collections/grid.less +716 -680
  161. package/src/definitions/collections/menu.less +173 -126
  162. package/src/definitions/collections/message.less +48 -46
  163. package/src/definitions/collections/table.less +849 -262
  164. package/src/definitions/elements/button.less +360 -347
  165. package/src/definitions/elements/container.less +126 -8
  166. package/src/definitions/elements/emoji.less +15 -9
  167. package/src/definitions/elements/flag.less +7 -17
  168. package/src/definitions/elements/header.less +42 -35
  169. package/src/definitions/elements/icon.less +38 -31
  170. package/src/definitions/elements/input.less +256 -21
  171. package/src/definitions/elements/label.less +92 -91
  172. package/src/definitions/elements/list.less +55 -45
  173. package/src/definitions/elements/loader.less +30 -29
  174. package/src/definitions/elements/segment.less +146 -27
  175. package/src/definitions/elements/step.less +52 -48
  176. package/src/definitions/elements/text.less +17 -15
  177. package/src/definitions/globals/site.less +23 -2
  178. package/src/definitions/modules/accordion.less +55 -5
  179. package/src/definitions/modules/calendar.js +5 -6
  180. package/src/definitions/modules/checkbox.js +16 -10
  181. package/src/definitions/modules/checkbox.less +34 -178
  182. package/src/definitions/modules/dimmer.less +21 -8
  183. package/src/definitions/modules/dropdown.js +57 -32
  184. package/src/definitions/modules/dropdown.less +101 -69
  185. package/src/definitions/modules/modal.js +116 -42
  186. package/src/definitions/modules/modal.less +2 -0
  187. package/src/definitions/modules/nag.less +20 -19
  188. package/src/definitions/modules/popup.less +5 -1
  189. package/src/definitions/modules/progress.js +3 -0
  190. package/src/definitions/modules/progress.less +19 -18
  191. package/src/definitions/modules/rating.less +49 -42
  192. package/src/definitions/modules/search.less +32 -16
  193. package/src/definitions/modules/sidebar.less +33 -19
  194. package/src/definitions/modules/slider.less +39 -38
  195. package/src/definitions/modules/tab.js +22 -4
  196. package/src/definitions/modules/toast.js +53 -26
  197. package/src/definitions/modules/toast.less +48 -16
  198. package/src/definitions/views/card.less +402 -361
  199. package/src/definitions/views/comment.less +92 -81
  200. package/src/definitions/views/feed.less +164 -144
  201. package/src/definitions/views/item.less +249 -196
  202. package/src/definitions/views/statistic.less +90 -88
  203. package/src/themes/bookish/elements/header.overrides +1 -1
  204. package/src/themes/chubby/elements/button.overrides +1 -1
  205. package/src/themes/chubby/elements/header.overrides +1 -1
  206. package/src/themes/default/collections/menu.variables +6 -0
  207. package/src/themes/default/collections/table.variables +52 -0
  208. package/src/themes/default/elements/button.variables +2 -1
  209. package/src/themes/default/elements/container.variables +8 -0
  210. package/src/themes/default/elements/flag.overrides +1635 -986
  211. package/src/themes/default/elements/flag.variables +7 -5
  212. package/src/themes/default/elements/icon.overrides +35 -28
  213. package/src/themes/default/elements/icon.variables +1 -0
  214. package/src/themes/default/elements/input.variables +15 -0
  215. package/src/themes/default/elements/segment.variables +8 -0
  216. package/src/themes/default/elements/step.overrides +1 -1
  217. package/src/themes/default/globals/site.variables +6 -0
  218. package/src/themes/default/globals/variation.variables +130 -6
  219. package/src/themes/default/modules/accordion.variables +15 -0
  220. package/src/themes/default/modules/checkbox.variables +5 -5
  221. package/src/themes/default/modules/dimmer.variables +1 -1
  222. package/src/themes/default/modules/dropdown.variables +1 -1
  223. package/src/themes/default/modules/toast.variables +3 -0
  224. package/src/themes/famfamfam/elements/flag.overrides +1026 -0
  225. package/src/themes/famfamfam/elements/flag.variables +13 -0
  226. package/src/themes/instagram/views/card.overrides +1 -1
  227. package/src/themes/material/collections/menu.overrides +1 -1
  228. package/src/themes/material/elements/button.overrides +1 -1
  229. package/src/themes/material/elements/header.overrides +1 -1
  230. package/src/themes/material/modules/dropdown.overrides +1 -1
  231. package/src/themes/material/modules/modal.overrides +1 -1
  232. package/src/themes/rtl/globals/site.overrides +1 -1
  233. package/tasks/build/css.js +6 -1
  234. package/test/helpers/sinon.js +1 -1
package/dist/semantic.js CHANGED
@@ -1,15 +1,15 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.19
2
+ * # Fomantic UI - 2.9.0-beta.190
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
6
- * Copyright 2021 Contributors
6
+ * Copyright 2022 Contributors
7
7
  * Released under the MIT license
8
8
  * http://opensource.org/licenses/MIT
9
9
  *
10
10
  */
11
11
  /*!
12
- * # Fomantic-UI 2.9.0-beta.19 - Site
12
+ * # Fomantic-UI 2.9.0-beta.190 - Site
13
13
  * http://github.com/fomantic/Fomantic-UI/
14
14
  *
15
15
  *
@@ -503,7 +503,7 @@ $.extend($.expr[ ":" ], {
503
503
  })( jQuery, window, document );
504
504
 
505
505
  /*!
506
- * # Fomantic-UI 2.9.0-beta.19 - Form Validation
506
+ * # Fomantic-UI 2.9.0-beta.190 - Form Validation
507
507
  * http://github.com/fomantic/Fomantic-UI/
508
508
  *
509
509
  *
@@ -923,6 +923,7 @@ $.fn.form = function(parameters) {
923
923
  $field.one('keyup' + eventNamespace, module.event.field.keyup);
924
924
  module.submit();
925
925
  module.debug('Enter pressed on input submitting form');
926
+ event.preventDefault();
926
927
  }
927
928
  keyHeldDown = true;
928
929
  }
@@ -1047,7 +1048,7 @@ $.fn.form = function(parameters) {
1047
1048
  parts,
1048
1049
  suffixPrompt
1049
1050
  ;
1050
- if(ancillary && ancillary.indexOf('..') >= 0) {
1051
+ if(ancillary && ['integer', 'decimal', 'number'].indexOf(ruleName) >= 0 && ancillary.indexOf('..') >= 0) {
1051
1052
  parts = ancillary.split('..', 2);
1052
1053
  if(!rule.prompt) {
1053
1054
  suffixPrompt = (
@@ -1390,13 +1391,13 @@ $.fn.form = function(parameters) {
1390
1391
  }
1391
1392
  if(settings.inline) {
1392
1393
  if(!promptExists) {
1393
- $prompt = settings.templates.prompt(errors, className.label);
1394
+ $prompt = $('<div/>').addClass(className.label);
1394
1395
  $prompt
1395
1396
  .appendTo($fieldGroup)
1396
1397
  ;
1397
1398
  }
1398
1399
  $prompt
1399
- .html(errors[0])
1400
+ .html(settings.templates.prompt(errors))
1400
1401
  ;
1401
1402
  if(!promptExists) {
1402
1403
  if(settings.transition && module.can.useElement('transition') && $module.transition('is supported')) {
@@ -1589,12 +1590,15 @@ $.fn.form = function(parameters) {
1589
1590
  }
1590
1591
  else if(isCheckbox) {
1591
1592
  module.verbose('Setting checkbox value', value, $element);
1592
- if(value === true || value === 1) {
1593
+ if(value === true || value === 1 || value === 'on') {
1593
1594
  $element.checkbox('check');
1594
1595
  }
1595
1596
  else {
1596
1597
  $element.checkbox('uncheck');
1597
1598
  }
1599
+ if(typeof value === 'string') {
1600
+ $field.val(value);
1601
+ }
1598
1602
  }
1599
1603
  else if(isDropdown) {
1600
1604
  module.verbose('Setting dropdown value', value, $element);
@@ -1707,7 +1711,7 @@ $.fn.form = function(parameters) {
1707
1711
  if(event && $module.data('moduleApi') !== undefined) {
1708
1712
  event.stopImmediatePropagation();
1709
1713
  }
1710
- if(settings.errorFocus) {
1714
+ if(settings.errorFocus && ignoreCallbacks !== true) {
1711
1715
  var focusElement, hasTabIndex = true;
1712
1716
  if (typeof settings.errorFocus === 'string') {
1713
1717
  focusElement = $(settings.errorFocus);
@@ -2030,7 +2034,7 @@ $.fn.form.settings = {
2030
2034
 
2031
2035
  autoCheckRequired : false,
2032
2036
  preventLeaving : false,
2033
- errorFocus : false,
2037
+ errorFocus : true,
2034
2038
  dateHandling : 'date', // 'date', 'input', 'formatter'
2035
2039
 
2036
2040
  onValid : function() {},
@@ -2086,7 +2090,6 @@ $.fn.form.settings = {
2086
2090
  doesntContain : '{name} cannot contain "{ruleValue}"',
2087
2091
  doesntContainExactly : '{name} cannot contain exactly "{ruleValue}"',
2088
2092
  minLength : '{name} must be at least {ruleValue} characters',
2089
- length : '{name} must be at least {ruleValue} characters',
2090
2093
  exactLength : '{name} must be exactly {ruleValue} characters',
2091
2094
  maxLength : '{name} cannot be longer than {ruleValue} characters',
2092
2095
  match : '{name} must match {ruleValue} field',
@@ -2100,7 +2103,7 @@ $.fn.form.settings = {
2100
2103
  selector : {
2101
2104
  checkbox : 'input[type="checkbox"], input[type="radio"]',
2102
2105
  clear : '.clear',
2103
- field : 'input:not(.search):not([type="file"]), textarea, select',
2106
+ field : 'input:not(.search):not([type="file"]):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',
2104
2107
  group : '.field',
2105
2108
  input : 'input:not([type="file"])',
2106
2109
  message : '.error.message',
@@ -2141,15 +2144,22 @@ $.fn.form.settings = {
2141
2144
  html += '<li>' + value + '</li>';
2142
2145
  });
2143
2146
  html += '</ul>';
2144
- return $(html);
2147
+ return html;
2145
2148
  },
2146
2149
 
2147
- // template that produces label
2148
- prompt: function(errors, labelClasses) {
2149
- return $('<div/>')
2150
- .addClass(labelClasses)
2151
- .html(errors[0])
2150
+ // template that produces label content
2151
+ prompt: function(errors) {
2152
+ if(errors.length === 1){
2153
+ return errors[0];
2154
+ }
2155
+ var
2156
+ html = '<ul class="ui list">'
2152
2157
  ;
2158
+ $.each(errors, function(index, value) {
2159
+ html += '<li>' + value + '</li>';
2160
+ });
2161
+ html += '</ul>';
2162
+ return html;
2153
2163
  }
2154
2164
  },
2155
2165
 
@@ -2359,14 +2369,6 @@ $.fn.form.settings = {
2359
2369
  ;
2360
2370
  },
2361
2371
 
2362
- // see rls notes for 2.0.6 (this is a duplicate of minLength)
2363
- length: function(value, requiredLength) {
2364
- return (value !== undefined)
2365
- ? (value.length >= requiredLength)
2366
- : false
2367
- ;
2368
- },
2369
-
2370
2372
  // is exactly length
2371
2373
  exactLength: function(value, requiredLength) {
2372
2374
  return (value !== undefined)
@@ -2575,7 +2577,7 @@ $.fn.form.settings = {
2575
2577
  })( jQuery, window, document );
2576
2578
 
2577
2579
  /*!
2578
- * # Fomantic-UI 2.9.0-beta.19 - Accordion
2580
+ * # Fomantic-UI 2.9.0-beta.190 - Accordion
2579
2581
  * http://github.com/fomantic/Fomantic-UI/
2580
2582
  *
2581
2583
  *
@@ -3194,7 +3196,7 @@ $.extend( $.easing, {
3194
3196
 
3195
3197
 
3196
3198
  /*!
3197
- * # Fomantic-UI 2.9.0-beta.19 - Calendar
3199
+ * # Fomantic-UI 2.9.0-beta.190 - Calendar
3198
3200
  * http://github.com/fomantic/Fomantic-UI/
3199
3201
  *
3200
3202
  *
@@ -3317,7 +3319,7 @@ $.fn.calendar = function(parameters) {
3317
3319
  module.set.maxDate($module.data(metadata.maxDate));
3318
3320
  }
3319
3321
  module.setting('type', module.get.type());
3320
- module.setting('on', settings.on || ($input.length ? 'focus' : 'click'));
3322
+ module.setting('on', settings.on || 'click');
3321
3323
  },
3322
3324
  popup: function () {
3323
3325
  if (settings.inline) {
@@ -3348,7 +3350,10 @@ $.fn.calendar = function(parameters) {
3348
3350
  module.refreshTooltips();
3349
3351
  return settings.onVisible.apply($container, arguments);
3350
3352
  };
3351
- var onHidden = settings.onHidden;
3353
+ var onHidden = function () {
3354
+ module.blur();
3355
+ return settings.onHidden.apply($container, arguments)
3356
+ }
3352
3357
  if (!$input.length) {
3353
3358
  //no input, $container has to handle focus/blur
3354
3359
  $container.attr('tabindex', '0');
@@ -3357,10 +3362,6 @@ $.fn.calendar = function(parameters) {
3357
3362
  module.focus();
3358
3363
  return settings.onVisible.apply($container, arguments);
3359
3364
  };
3360
- onHidden = function () {
3361
- module.blur();
3362
- return settings.onHidden.apply($container, arguments);
3363
- };
3364
3365
  }
3365
3366
  var onShow = function () {
3366
3367
  //reset the focus date onShow
@@ -5067,7 +5068,7 @@ $.fn.calendar.settings = {
5067
5068
  })(jQuery, window, document);
5068
5069
 
5069
5070
  /*!
5070
- * # Fomantic-UI 2.9.0-beta.19 - Checkbox
5071
+ * # Fomantic-UI 2.9.0-beta.190 - Checkbox
5071
5072
  * http://github.com/fomantic/Fomantic-UI/
5072
5073
  *
5073
5074
  *
@@ -5307,18 +5308,26 @@ $.fn.checkbox = function(parameters) {
5307
5308
  }
5308
5309
  }
5309
5310
 
5311
+ shortcutPressed = false;
5310
5312
  if(key == keyCode.escape) {
5311
5313
  module.verbose('Escape key pressed blurring field');
5312
5314
  $input.blur();
5313
5315
  shortcutPressed = true;
5314
5316
  }
5315
- else if(!event.ctrlKey && ( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey)) ) {
5316
- module.verbose('Enter/space key pressed, toggling checkbox');
5317
- module.toggle();
5318
- shortcutPressed = true;
5319
- }
5320
- else {
5321
- shortcutPressed = false;
5317
+ else if(!event.ctrlKey && module.can.change()) {
5318
+ if( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey) ) {
5319
+ module.verbose('Enter/space key pressed, toggling checkbox');
5320
+ module.toggle();
5321
+ shortcutPressed = true;
5322
+ } else if($module.is('.toggle, .slider') && !module.is.radio()) {
5323
+ if(key == keyCode.left && module.is.checked()) {
5324
+ module.uncheck();
5325
+ shortcutPressed = true;
5326
+ } else if(key == keyCode.right && module.is.unchecked()) {
5327
+ module.check();
5328
+ shortcutPressed = true;
5329
+ }
5330
+ }
5322
5331
  }
5323
5332
  },
5324
5333
  keyup: function(event) {
@@ -5391,7 +5400,6 @@ $.fn.checkbox = function(parameters) {
5391
5400
  settings.onEnable.call(input);
5392
5401
  // preserve legacy callbacks
5393
5402
  settings.onEnabled.call(input);
5394
- module.trigger.change();
5395
5403
  }
5396
5404
  },
5397
5405
 
@@ -5406,7 +5414,6 @@ $.fn.checkbox = function(parameters) {
5406
5414
  settings.onDisable.call(input);
5407
5415
  // preserve legacy callbacks
5408
5416
  settings.onDisabled.call(input);
5409
- module.trigger.change();
5410
5417
  }
5411
5418
  },
5412
5419
 
@@ -5934,7 +5941,7 @@ $.fn.checkbox.settings = {
5934
5941
 
5935
5942
  selector : {
5936
5943
  checkbox : '.ui.checkbox',
5937
- label : 'label, .box',
5944
+ label : 'label',
5938
5945
  input : 'input[type="checkbox"], input[type="radio"]',
5939
5946
  link : 'a[href]'
5940
5947
  }
@@ -5944,7 +5951,7 @@ $.fn.checkbox.settings = {
5944
5951
  })( jQuery, window, document );
5945
5952
 
5946
5953
  /*!
5947
- * # Fomantic-UI 2.9.0-beta.19 - Dimmer
5954
+ * # Fomantic-UI 2.9.0-beta.190 - Dimmer
5948
5955
  * http://github.com/fomantic/Fomantic-UI/
5949
5956
  *
5950
5957
  *
@@ -6701,7 +6708,7 @@ $.fn.dimmer.settings = {
6701
6708
  })( jQuery, window, document );
6702
6709
 
6703
6710
  /*!
6704
- * # Fomantic-UI 2.9.0-beta.19 - Dropdown
6711
+ * # Fomantic-UI 2.9.0-beta.190 - Dropdown
6705
6712
  * http://github.com/fomantic/Fomantic-UI/
6706
6713
  *
6707
6714
  *
@@ -6902,6 +6909,7 @@ $.fn.dropdown = function(parameters) {
6902
6909
  select: function() {
6903
6910
  if(module.has.input() && selectObserver) {
6904
6911
  selectObserver.observe($module[0], {
6912
+ attributes: true,
6905
6913
  childList : true,
6906
6914
  subtree : true
6907
6915
  });
@@ -7123,6 +7131,9 @@ $.fn.dropdown = function(parameters) {
7123
7131
  module.debug('Disabling dropdown');
7124
7132
  $module.addClass(className.disabled);
7125
7133
  }
7134
+ if($input.is('[required]')) {
7135
+ settings.forceSelection = true;
7136
+ }
7126
7137
  $input
7127
7138
  .removeAttr('required')
7128
7139
  .removeAttr('class')
@@ -7327,6 +7338,11 @@ $.fn.dropdown = function(parameters) {
7327
7338
  $module
7328
7339
  .on('change' + eventNamespace, selector.input, module.event.change)
7329
7340
  ;
7341
+ if(module.is.multiple() && module.is.searchSelection()) {
7342
+ $module
7343
+ .on('paste' + eventNamespace, selector.search, module.event.paste)
7344
+ ;
7345
+ }
7330
7346
  },
7331
7347
  mouseEvents: function() {
7332
7348
  module.verbose('Binding mouse events');
@@ -7546,7 +7562,7 @@ $.fn.dropdown = function(parameters) {
7546
7562
  var value = module.is.multiple() ? module.get.values() : module.get.value();
7547
7563
  if (value !== '') {
7548
7564
  module.verbose('Value(s) present after click icon, select value(s) in items');
7549
- module.set.selected(value, null, null, true);
7565
+ module.set.selected(value, null, true, true);
7550
7566
  }
7551
7567
  }
7552
7568
  iconClicked = false;
@@ -7775,6 +7791,15 @@ $.fn.dropdown = function(parameters) {
7775
7791
  },
7776
7792
 
7777
7793
  event: {
7794
+ paste: function(event) {
7795
+ var pasteValue = (event.originalEvent.clipboardData || window.clipboardData).getData('text'),
7796
+ tokens = pasteValue.split(settings.delimiter)
7797
+ ;
7798
+ tokens.forEach(function(value){
7799
+ module.set.selected(module.escape.htmlEntities(value.trim()), null, true, true);
7800
+ });
7801
+ event.preventDefault();
7802
+ },
7778
7803
  change: function() {
7779
7804
  if(!internalChange) {
7780
7805
  module.debug('Input changed, updating selection');
@@ -7987,8 +8012,8 @@ $.fn.dropdown = function(parameters) {
7987
8012
  },
7988
8013
  select: {
7989
8014
  mutation: function(mutations) {
7990
- module.debug('<select> modified, recreating menu');
7991
8015
  if(module.is.selectMutation(mutations)) {
8016
+ module.debug('<select> modified, recreating menu');
7992
8017
  module.disconnect.selectObserver();
7993
8018
  module.refresh();
7994
8019
  module.setup.select();
@@ -8233,7 +8258,7 @@ $.fn.dropdown = function(parameters) {
8233
8258
  hasSubMenu = ($subMenu.length> 0),
8234
8259
  hasSelectedItem = ($selectedItem.length > 0),
8235
8260
  selectedIsSelectable = ($selectedItem.not(selector.unselectable).length > 0),
8236
- delimiterPressed = (pressedKey == keys.delimiter && settings.allowAdditions && module.is.multiple()),
8261
+ delimiterPressed = (pressedKey == keys.delimiter && module.is.multiple()),
8237
8262
  isAdditionWithoutMenu = (settings.allowAdditions && settings.hideAdditions && (pressedKey == keys.enter || delimiterPressed) && selectedIsSelectable),
8238
8263
  $nextItem,
8239
8264
  isSubMenuItem,
@@ -8331,7 +8356,7 @@ $.fn.dropdown = function(parameters) {
8331
8356
  .addClass(className.selected)
8332
8357
  ;
8333
8358
  module.set.scrollPosition($nextItem);
8334
- if(settings.selectOnKeydown && module.is.single()) {
8359
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
8335
8360
  module.set.selectedItem($nextItem);
8336
8361
  }
8337
8362
  }
@@ -8358,7 +8383,7 @@ $.fn.dropdown = function(parameters) {
8358
8383
  .addClass(className.selected)
8359
8384
  ;
8360
8385
  module.set.scrollPosition($nextItem);
8361
- if(settings.selectOnKeydown && module.is.single()) {
8386
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
8362
8387
  module.set.selectedItem($nextItem);
8363
8388
  }
8364
8389
  }
@@ -8489,7 +8514,7 @@ $.fn.dropdown = function(parameters) {
8489
8514
  ;
8490
8515
  if( module.can.activate( $(element) ) ) {
8491
8516
  module.set.selected(value, $(element));
8492
- if(!module.is.multiple()) {
8517
+ if(!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
8493
8518
  module.hideAndClear();
8494
8519
  }
8495
8520
  }
@@ -8502,7 +8527,7 @@ $.fn.dropdown = function(parameters) {
8502
8527
  ;
8503
8528
  if( module.can.activate( $(element) ) ) {
8504
8529
  module.set.value(value, text, $(element));
8505
- if(!module.is.multiple()) {
8530
+ if(!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
8506
8531
  module.hideAndClear();
8507
8532
  }
8508
8533
  }
@@ -9022,7 +9047,7 @@ $.fn.dropdown = function(parameters) {
9022
9047
  module.error(error.noStorage);
9023
9048
  return;
9024
9049
  }
9025
- name = sessionStorage.getItem(value);
9050
+ name = sessionStorage.getItem(value + elementNamespace);
9026
9051
  return (name !== undefined)
9027
9052
  ? name
9028
9053
  : false
@@ -9066,7 +9091,7 @@ $.fn.dropdown = function(parameters) {
9066
9091
  return;
9067
9092
  }
9068
9093
  module.verbose('Saving remote data to session storage', value, name);
9069
- sessionStorage.setItem(value, name);
9094
+ sessionStorage.setItem(value + elementNamespace, name);
9070
9095
  }
9071
9096
  },
9072
9097
 
@@ -9126,7 +9151,7 @@ $.fn.dropdown = function(parameters) {
9126
9151
  $nextSelectedItem
9127
9152
  .addClass(className.selected)
9128
9153
  ;
9129
- if(settings.selectOnKeydown && module.is.single()) {
9154
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
9130
9155
  module.set.selectedItem($nextSelectedItem);
9131
9156
  }
9132
9157
  $menu
@@ -9329,7 +9354,7 @@ $.fn.dropdown = function(parameters) {
9329
9354
  module.set.scrollPosition($nextValue);
9330
9355
  $selectedItem.removeClass(className.selected);
9331
9356
  $nextValue.addClass(className.selected);
9332
- if(settings.selectOnKeydown && module.is.single()) {
9357
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
9333
9358
  module.set.selectedItem($nextValue);
9334
9359
  }
9335
9360
  }
@@ -9467,17 +9492,24 @@ $.fn.dropdown = function(parameters) {
9467
9492
 
9468
9493
  isFiltered = $selected.hasClass(className.filtered),
9469
9494
  isActive = $selected.hasClass(className.active),
9495
+ isActionable = $selected.hasClass(className.actionable),
9470
9496
  isUserValue = $selected.hasClass(className.addition),
9471
9497
  shouldAnimate = (isMultiple && $selectedItem.length == 1)
9472
9498
  ;
9473
- if(isMultiple) {
9499
+ if(isActionable){
9500
+ if((!isMultiple || (!isActive || isUserValue)) && settings.apiSettings && settings.saveRemoteData) {
9501
+ module.save.remoteData(selectedText, selectedValue);
9502
+ }
9503
+ settings.onActionable.call(element, selectedValue, selectedText, $selected);
9504
+ }
9505
+ else if(isMultiple) {
9474
9506
  if(!isActive || isUserValue) {
9475
9507
  if(settings.apiSettings && settings.saveRemoteData) {
9476
9508
  module.save.remoteData(selectedText, selectedValue);
9477
9509
  }
9478
9510
  if(settings.useLabels) {
9479
- module.add.label(selectedValue, selectedText, shouldAnimate);
9480
9511
  module.add.value(selectedValue, selectedText, $selected);
9512
+ module.add.label(selectedValue, selectedText, shouldAnimate);
9481
9513
  module.set.activeItem($selected);
9482
9514
  module.filterActive();
9483
9515
  module.select.nextAvailable($selectedItem);
@@ -9497,7 +9529,7 @@ $.fn.dropdown = function(parameters) {
9497
9529
  if(settings.apiSettings && settings.saveRemoteData) {
9498
9530
  module.save.remoteData(selectedText, selectedValue);
9499
9531
  }
9500
- if (!keepSearchTerm) {
9532
+ if (!keepSearchTerm && !$selected.hasClass(className.actionable)) {
9501
9533
  module.set.text(selectedText);
9502
9534
  }
9503
9535
  module.set.value(selectedValue, selectedText, $selected, preventChangeTrigger);
@@ -9687,7 +9719,7 @@ $.fn.dropdown = function(parameters) {
9687
9719
  }
9688
9720
  // extend current array
9689
9721
  if(Array.isArray(currentValue)) {
9690
- newValue = currentValue.concat([addedValue]);
9722
+ newValue = $selectedItem.hasClass(className.actionable) ? currentValue : currentValue.concat([addedValue]);
9691
9723
  newValue = module.get.uniqueArray(newValue);
9692
9724
  }
9693
9725
  else {
@@ -9771,18 +9803,10 @@ $.fn.dropdown = function(parameters) {
9771
9803
  return;
9772
9804
  }
9773
9805
  // temporarily disconnect observer
9774
- if(selectObserver) {
9775
- selectObserver.disconnect();
9776
- module.verbose('Temporarily disconnecting mutation observer');
9777
- }
9806
+ module.disconnect.selectObserver();
9778
9807
  $option.remove();
9779
9808
  module.verbose('Removing user addition as an <option>', escapedValue);
9780
- if(selectObserver) {
9781
- selectObserver.observe($input[0], {
9782
- childList : true,
9783
- subtree : true
9784
- });
9785
- }
9809
+ module.observe.select();
9786
9810
  },
9787
9811
  message: function() {
9788
9812
  $menu.children(selector.message).remove();
@@ -10147,7 +10171,7 @@ $.fn.dropdown = function(parameters) {
10147
10171
  selectChanged = false
10148
10172
  ;
10149
10173
  $.each(mutations, function(index, mutation) {
10150
- if($(mutation.target).is('select') || $(mutation.addedNodes).is('select')) {
10174
+ if($(mutation.target).is('select, option, optgroup') || $(mutation.addedNodes).is('select')) {
10151
10175
  selectChanged = true;
10152
10176
  return false;
10153
10177
  }
@@ -10692,7 +10716,7 @@ $.fn.dropdown.settings = {
10692
10716
  keepOnScreen : true, // Whether dropdown should check whether it is on screen before showing
10693
10717
 
10694
10718
  match : 'both', // what to match against with search selection (both, text, or label)
10695
- fullTextSearch : false, // search anywhere in value (set to 'exact' to require exact matches)
10719
+ fullTextSearch : 'exact', // search anywhere in value (set to 'exact' to require exact matches)
10696
10720
  ignoreDiacritics : false, // match results also if they contain diacritics of the same base character (for example searching for "a" will also match "á" or "â" or "à", etc...)
10697
10721
  hideDividers : false, // Whether to hide any divider elements (specified in selector.divider) that are sibling to any items when searched (set to true will hide all dividers, set to 'empty' will hide them when they are not followed by a visible item)
10698
10722
 
@@ -10700,7 +10724,7 @@ $.fn.dropdown.settings = {
10700
10724
  preserveHTML : true, // preserve html when selecting value
10701
10725
  sortSelect : false, // sort selection on init
10702
10726
 
10703
- forceSelection : true, // force a choice on blur with search selection
10727
+ forceSelection : false, // force a choice on blur with search selection
10704
10728
 
10705
10729
  allowAdditions : false, // whether multiple select should allow user added values
10706
10730
  ignoreCase : false, // whether to consider case sensitivity when creating labels
@@ -10711,7 +10735,7 @@ $.fn.dropdown.settings = {
10711
10735
  useLabels : true, // whether multiple select should filter currently active selections from choices
10712
10736
  delimiter : ',', // when multiselect uses normal <input> the values will be delimited with this character
10713
10737
 
10714
- showOnFocus : true, // show menu on focus
10738
+ showOnFocus : false, // show menu on focus
10715
10739
  allowReselection : false, // whether current value should trigger callbacks when reselected
10716
10740
  allowTab : true, // add tabindex to element
10717
10741
  allowCategorySelection : false, // allow elements with sub-menus to be selected
@@ -10726,6 +10750,8 @@ $.fn.dropdown.settings = {
10726
10750
 
10727
10751
  headerDivider : true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>
10728
10752
 
10753
+ collapseOnActionable : true, // whether the dropdown should collapse upon selection of an actionable item
10754
+
10729
10755
  // label settings on multi-select
10730
10756
  label: {
10731
10757
  transition : 'scale',
@@ -10745,6 +10771,7 @@ $.fn.dropdown.settings = {
10745
10771
  onChange : function(value, text, $selected){},
10746
10772
  onAdd : function(value, text, $selected){},
10747
10773
  onRemove : function(value, text, $selected){},
10774
+ onActionable : function(value, text, $selected){},
10748
10775
  onSearch : function(searchTerm){},
10749
10776
 
10750
10777
  onLabelSelect : function($selectedLabels){},
@@ -10807,7 +10834,8 @@ $.fn.dropdown.settings = {
10807
10834
  icon : 'icon', // optional icon name
10808
10835
  iconClass : 'iconClass', // optional individual class for icon (for example to use flag instead)
10809
10836
  class : 'class', // optional individual class for item/header
10810
- divider : 'divider' // optional divider append for group headers
10837
+ divider : 'divider', // optional divider append for group headers
10838
+ actionable : 'actionable' // optional actionable item
10811
10839
  },
10812
10840
 
10813
10841
  keys : {
@@ -10879,7 +10907,8 @@ $.fn.dropdown.settings = {
10879
10907
  header : 'header',
10880
10908
  divider : 'divider',
10881
10909
  groupIcon : '',
10882
- unfilterable : 'unfilterable'
10910
+ unfilterable : 'unfilterable',
10911
+ actionable : 'actionable'
10883
10912
  }
10884
10913
 
10885
10914
  };
@@ -10954,6 +10983,9 @@ $.fn.dropdown.settings.templates = {
10954
10983
  maybeText = (option[fields.text])
10955
10984
  ? ' data-text="' + deQuote(option[fields.text],true) + '"'
10956
10985
  : '',
10986
+ maybeActionable = (option[fields.actionable])
10987
+ ? className.actionable+' '
10988
+ : '',
10957
10989
  maybeDisabled = (option[fields.disabled])
10958
10990
  ? className.disabled+' '
10959
10991
  : '',
@@ -10962,7 +10994,7 @@ $.fn.dropdown.settings.templates = {
10962
10994
  : '',
10963
10995
  hasDescription = (escape(option[fields.description] || '', preserveHTML) != '')
10964
10996
  ;
10965
- html += '<div class="'+ maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? deQuote(option[fields.class]) : className.item)+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
10997
+ html += '<div class="'+ maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? deQuote(option[fields.class]) : className.item)+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
10966
10998
  if (isMenu) {
10967
10999
  html += '<i class="'+ (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
10968
11000
  }
@@ -11032,7 +11064,7 @@ $.fn.dropdown.settings.templates = {
11032
11064
  })( jQuery, window, document );
11033
11065
 
11034
11066
  /*!
11035
- * # Fomantic-UI 2.9.0-beta.19 - Embed
11067
+ * # Fomantic-UI 2.9.0-beta.190 - Embed
11036
11068
  * http://github.com/fomantic/Fomantic-UI/
11037
11069
  *
11038
11070
  *
@@ -11742,7 +11774,7 @@ $.fn.embed.settings = {
11742
11774
  })( jQuery, window, document );
11743
11775
 
11744
11776
  /*!
11745
- * # Fomantic-UI 2.9.0-beta.19 - Modal
11777
+ * # Fomantic-UI 2.9.0-beta.190 - Modal
11746
11778
  * http://github.com/fomantic/Fomantic-UI/
11747
11779
  *
11748
11780
  *
@@ -11809,7 +11841,8 @@ $.fn.modal = function(parameters) {
11809
11841
 
11810
11842
  $module = $(this),
11811
11843
  $context = $(settings.context),
11812
- $close = $module.find(selector.close),
11844
+ $closeIcon = $module.find(selector.closeIcon),
11845
+ $inputs,
11813
11846
 
11814
11847
  $allModals,
11815
11848
  $otherModals,
@@ -11835,6 +11868,7 @@ $.fn.modal = function(parameters) {
11835
11868
  module = {
11836
11869
 
11837
11870
  initialize: function() {
11871
+ module.create.id();
11838
11872
  if(!$module.hasClass('modal')) {
11839
11873
  module.create.modal();
11840
11874
  if(!$.isFunction(settings.onHidden)) {
@@ -11859,15 +11893,17 @@ $.fn.modal = function(parameters) {
11859
11893
  $actions.empty();
11860
11894
  }
11861
11895
  settings.actions.forEach(function (el) {
11862
- var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
11896
+ var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
11863
11897
  text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
11864
11898
  cls = module.helpers.deQuote(el[fields.class] || ''),
11865
11899
  click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
11866
11900
  $actions.append($('<button/>', {
11867
11901
  html: icon + text,
11902
+ 'aria-label': $('<div>'+(el[fields.text] || el[fields.icon] || '')+'</div>').text(),
11868
11903
  class: className.button + ' ' + cls,
11869
11904
  click: function () {
11870
- if (click.call(element, $module) === false) {
11905
+ var button = $(this);
11906
+ if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
11871
11907
  return;
11872
11908
  }
11873
11909
  module.hide();
@@ -11878,7 +11914,6 @@ $.fn.modal = function(parameters) {
11878
11914
  module.cache = {};
11879
11915
  module.verbose('Initializing dimmer', $context);
11880
11916
 
11881
- module.create.id();
11882
11917
  module.create.dimmer();
11883
11918
 
11884
11919
  if ( settings.allowMultiple ) {
@@ -11888,11 +11923,9 @@ $.fn.modal = function(parameters) {
11888
11923
  $module.addClass('top aligned');
11889
11924
  }
11890
11925
  module.refreshModals();
11891
-
11926
+ module.refreshInputs();
11892
11927
  module.bind.events();
11893
- if(settings.observeChanges) {
11894
- module.observeChanges();
11895
- }
11928
+ module.observeChanges();
11896
11929
  module.instantiate();
11897
11930
  if(settings.autoShow){
11898
11931
  module.show();
@@ -11909,16 +11942,20 @@ $.fn.modal = function(parameters) {
11909
11942
 
11910
11943
  create: {
11911
11944
  modal: function() {
11912
- $module = $('<div/>', {class: className.modal});
11945
+ $module = $('<div/>', {class: className.modal, role: 'dialog', 'aria-modal': true});
11913
11946
  if (settings.closeIcon) {
11914
- $close = $('<i/>', {class: className.close})
11915
- $module.append($close);
11947
+ $closeIcon = $('<i/>', {class: className.close, role: 'button', tabindex: 0, 'aria-label': settings.text.close})
11948
+ $module.append($closeIcon);
11916
11949
  }
11917
11950
  if (settings.title !== '') {
11918
- $('<div/>', {class: className.title}).appendTo($module);
11951
+ var titleId = '_' + module.get.id() + 'title';
11952
+ $module.attr('aria-labelledby', titleId);
11953
+ $('<div/>', {class: className.title, id: titleId}).appendTo($module);
11919
11954
  }
11920
11955
  if (settings.content !== '') {
11921
- $('<div/>', {class: className.content}).appendTo($module);
11956
+ var descId = '_' + module.get.id() + 'desc';
11957
+ $module.attr('aria-describedby', descId);
11958
+ $('<div/>', {class: className.content, id: descId}).appendTo($module);
11922
11959
  }
11923
11960
  if (module.has.configActions()) {
11924
11961
  $('<div/>', {class: className.actions}).appendTo($module);
@@ -11971,15 +12008,21 @@ $.fn.modal = function(parameters) {
11971
12008
  ;
11972
12009
  $window.off(elementEventNamespace);
11973
12010
  $dimmer.off(elementEventNamespace);
11974
- $close.off(eventNamespace);
12011
+ $closeIcon.off(elementEventNamespace);
12012
+ if($inputs) {
12013
+ $inputs.off(elementEventNamespace);
12014
+ }
11975
12015
  $context.dimmer('destroy');
11976
12016
  },
11977
12017
 
11978
12018
  observeChanges: function() {
11979
12019
  if('MutationObserver' in window) {
11980
12020
  observer = new MutationObserver(function(mutations) {
11981
- module.debug('DOM tree modified, refreshing');
11982
- module.refresh();
12021
+ if(settings.observeChanges) {
12022
+ module.debug('DOM tree modified, refreshing');
12023
+ module.refresh();
12024
+ }
12025
+ module.refreshInputs();
11983
12026
  });
11984
12027
  observer.observe(element, {
11985
12028
  childList : true,
@@ -12004,6 +12047,23 @@ $.fn.modal = function(parameters) {
12004
12047
  $allModals = $otherModals.add($module);
12005
12048
  },
12006
12049
 
12050
+ refreshInputs: function(){
12051
+ if($inputs){
12052
+ $inputs
12053
+ .off('keydown' + elementEventNamespace)
12054
+ ;
12055
+ }
12056
+ $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
12057
+ return $(this).closest('.disabled').length === 0;
12058
+ });
12059
+ $inputs.first()
12060
+ .on('keydown' + elementEventNamespace, module.event.inputKeyDown.first)
12061
+ ;
12062
+ $inputs.last()
12063
+ .on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
12064
+ ;
12065
+ },
12066
+
12007
12067
  attachEvents: function(selector, event) {
12008
12068
  var
12009
12069
  $toggle = $(selector)
@@ -12032,6 +12092,9 @@ $.fn.modal = function(parameters) {
12032
12092
  .on('click' + eventNamespace, selector.approve, module.event.approve)
12033
12093
  .on('click' + eventNamespace, selector.deny, module.event.deny)
12034
12094
  ;
12095
+ $closeIcon
12096
+ .on('keyup' + elementEventNamespace, module.event.closeKeyUp)
12097
+ ;
12035
12098
  $window
12036
12099
  .on('resize' + elementEventNamespace, module.event.resize)
12037
12100
  ;
@@ -12050,7 +12113,7 @@ $.fn.modal = function(parameters) {
12050
12113
 
12051
12114
  get: {
12052
12115
  id: function() {
12053
- return (Math.random().toString(16) + '000000000').substr(2, 8);
12116
+ return id;
12054
12117
  },
12055
12118
  element: function() {
12056
12119
  return $module;
@@ -12089,10 +12152,38 @@ $.fn.modal = function(parameters) {
12089
12152
  close: function() {
12090
12153
  module.hide();
12091
12154
  },
12155
+ closeKeyUp: function(event){
12156
+ var
12157
+ keyCode = event.which
12158
+ ;
12159
+ if ((keyCode === settings.keys.enter || keyCode === settings.keys.space) && $module.hasClass(className.front)) {
12160
+ module.hide();
12161
+ }
12162
+ },
12163
+ inputKeyDown: {
12164
+ first: function(event) {
12165
+ var
12166
+ keyCode = event.which
12167
+ ;
12168
+ if (keyCode === settings.keys.tab && event.shiftKey) {
12169
+ $inputs.last().focus();
12170
+ event.preventDefault();
12171
+ }
12172
+ },
12173
+ last: function(event) {
12174
+ var
12175
+ keyCode = event.which
12176
+ ;
12177
+ if (keyCode === settings.keys.tab && !event.shiftKey) {
12178
+ $inputs.first().focus();
12179
+ event.preventDefault();
12180
+ }
12181
+ }
12182
+ },
12092
12183
  mousedown: function(event) {
12093
12184
  var
12094
12185
  $target = $(event.target),
12095
- isRtl = module.is.rtl();
12186
+ isRtl = module.is.rtl()
12096
12187
  ;
12097
12188
  initialMouseDownInModal = ($target.closest(selector.modal).length > 0);
12098
12189
  if(initialMouseDownInModal) {
@@ -12140,10 +12231,9 @@ $.fn.modal = function(parameters) {
12140
12231
  },
12141
12232
  keyboard: function(event) {
12142
12233
  var
12143
- keyCode = event.which,
12144
- escapeKey = 27
12234
+ keyCode = event.which
12145
12235
  ;
12146
- if(keyCode == escapeKey) {
12236
+ if(keyCode === settings.keys.escape) {
12147
12237
  if(settings.closable) {
12148
12238
  module.debug('Escape key pressed hiding modal');
12149
12239
  if ( $module.hasClass(className.front) ) {
@@ -12458,7 +12548,7 @@ $.fn.modal = function(parameters) {
12458
12548
  $module
12459
12549
  .off('mousedown' + elementEventNamespace)
12460
12550
  ;
12461
- }
12551
+ }
12462
12552
  $dimmer
12463
12553
  .off('mousedown' + elementEventNamespace)
12464
12554
  ;
@@ -12643,13 +12733,10 @@ $.fn.modal = function(parameters) {
12643
12733
  set: {
12644
12734
  autofocus: function() {
12645
12735
  var
12646
- $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
12647
- return $(this).closest('.disabled').length === 0;
12648
- }),
12649
12736
  $autofocus = $inputs.filter('[autofocus]'),
12650
12737
  $input = ($autofocus.length > 0)
12651
12738
  ? $autofocus.first()
12652
- : $inputs.first()
12739
+ : ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
12653
12740
  ;
12654
12741
  if($input.length > 0) {
12655
12742
  $input.focus();
@@ -12731,7 +12818,7 @@ $.fn.modal = function(parameters) {
12731
12818
  ? $(document).scrollTop() + settings.padding
12732
12819
  : $(document).scrollTop() + (module.cache.contextHeight - module.cache.height - settings.padding),
12733
12820
  marginLeft: -(module.cache.width / 2)
12734
- })
12821
+ })
12735
12822
  ;
12736
12823
  } else {
12737
12824
  $module
@@ -12740,7 +12827,7 @@ $.fn.modal = function(parameters) {
12740
12827
  ? -(module.cache.height / 2)
12741
12828
  : settings.padding / 2,
12742
12829
  marginLeft: -(module.cache.width / 2)
12743
- })
12830
+ })
12744
12831
  ;
12745
12832
  }
12746
12833
  module.verbose('Setting modal offset for legacy mode');
@@ -13066,11 +13153,19 @@ $.fn.modal.settings = {
13066
13153
  // called after deny selector match
13067
13154
  onDeny : function(){ return true; },
13068
13155
 
13156
+ keys : {
13157
+ space : 32,
13158
+ enter : 13,
13159
+ escape : 27,
13160
+ tab : 9,
13161
+ },
13162
+
13069
13163
  selector : {
13070
13164
  title : '> .header',
13071
13165
  content : '> .content',
13072
13166
  actions : '> .actions',
13073
13167
  close : '> .close',
13168
+ closeIcon: '> .close',
13074
13169
  approve : '.actions .positive, .actions .approve, .actions .ok',
13075
13170
  deny : '.actions .negative, .actions .deny, .actions .cancel',
13076
13171
  modal : '.ui.modal',
@@ -13106,7 +13201,8 @@ $.fn.modal.settings = {
13106
13201
  },
13107
13202
  text: {
13108
13203
  ok : 'Ok',
13109
- cancel: 'Cancel'
13204
+ cancel: 'Cancel',
13205
+ close : 'Close'
13110
13206
  }
13111
13207
  };
13112
13208
 
@@ -13132,33 +13228,39 @@ $.fn.modal.settings.templates = {
13132
13228
  },
13133
13229
  alert: function () {
13134
13230
  var settings = this.get.settings(),
13135
- args = settings.templates.getArguments(arguments)
13231
+ args = settings.templates.getArguments(arguments),
13232
+ approveFn = args.handler
13136
13233
  ;
13137
13234
  return {
13138
13235
  title : args.title,
13139
13236
  content: args.content,
13237
+ onApprove: approveFn,
13140
13238
  actions: [{
13141
13239
  text : settings.text.ok,
13142
13240
  class: settings.className.ok,
13143
- click: args.handler
13241
+ click: approveFn
13144
13242
  }]
13145
13243
  }
13146
13244
  },
13147
13245
  confirm: function () {
13148
13246
  var settings = this.get.settings(),
13149
- args = settings.templates.getArguments(arguments)
13247
+ args = settings.templates.getArguments(arguments),
13248
+ approveFn = function(){args.handler(true)},
13249
+ denyFn = function(){args.handler(false)}
13150
13250
  ;
13151
13251
  return {
13152
13252
  title : args.title,
13153
13253
  content: args.content,
13254
+ onApprove: approveFn,
13255
+ onDeny: denyFn,
13154
13256
  actions: [{
13155
13257
  text : settings.text.ok,
13156
13258
  class: settings.className.ok,
13157
- click: function(){args.handler(true)}
13259
+ click: approveFn
13158
13260
  },{
13159
13261
  text: settings.text.cancel,
13160
13262
  class: settings.className.cancel,
13161
- click: function(){args.handler(false)}
13263
+ click: denyFn
13162
13264
  }]
13163
13265
  }
13164
13266
  },
@@ -13166,7 +13268,14 @@ $.fn.modal.settings.templates = {
13166
13268
  var $this = this,
13167
13269
  settings = this.get.settings(),
13168
13270
  args = settings.templates.getArguments(arguments),
13169
- input = $($.parseHTML(args.content)).filter('.ui.input')
13271
+ input = $($.parseHTML(args.content)).filter('.ui.input'),
13272
+ approveFn = function(){
13273
+ var settings = $this.get.settings(),
13274
+ inputField = $this.get.element().find(settings.selector.prompt)[0]
13275
+ ;
13276
+ args.handler($(inputField).val());
13277
+ },
13278
+ denyFn = function(){args.handler(null)}
13170
13279
  ;
13171
13280
  if (input.length === 0) {
13172
13281
  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>';
@@ -13174,19 +13283,16 @@ $.fn.modal.settings.templates = {
13174
13283
  return {
13175
13284
  title : args.title,
13176
13285
  content: args.content,
13286
+ onApprove: approveFn,
13287
+ onDeny: denyFn,
13177
13288
  actions: [{
13178
13289
  text: settings.text.ok,
13179
13290
  class: settings.className.ok,
13180
- click: function(){
13181
- var settings = $this.get.settings(),
13182
- inputField = $this.get.element().find(settings.selector.prompt)[0]
13183
- ;
13184
- args.handler($(inputField).val());
13185
- }
13291
+ click: approveFn
13186
13292
  },{
13187
13293
  text: settings.text.cancel,
13188
13294
  class: settings.className.cancel,
13189
- click: function(){args.handler(null)}
13295
+ click: denyFn
13190
13296
  }]
13191
13297
  }
13192
13298
  }
@@ -13195,7 +13301,7 @@ $.fn.modal.settings.templates = {
13195
13301
  })( jQuery, window, document );
13196
13302
 
13197
13303
  /*!
13198
- * # Fomantic-UI 2.9.0-beta.19 - Nag
13304
+ * # Fomantic-UI 2.9.0-beta.190 - Nag
13199
13305
  * http://github.com/fomantic/Fomantic-UI/
13200
13306
  *
13201
13307
  *
@@ -13754,7 +13860,7 @@ $.extend( $.easing, {
13754
13860
  })( jQuery, window, document );
13755
13861
 
13756
13862
  /*!
13757
- * # Fomantic-UI 2.9.0-beta.19 - Popup
13863
+ * # Fomantic-UI 2.9.0-beta.190 - Popup
13758
13864
  * http://github.com/fomantic/Fomantic-UI/
13759
13865
  *
13760
13866
  *
@@ -15296,7 +15402,7 @@ $.fn.popup.settings = {
15296
15402
  })( jQuery, window, document );
15297
15403
 
15298
15404
  /*!
15299
- * # Fomantic-UI 2.9.0-beta.19 - Progress
15405
+ * # Fomantic-UI 2.9.0-beta.190 - Progress
15300
15406
  * http://github.com/fomantic/Fomantic-UI/
15301
15407
  *
15302
15408
  *
@@ -15904,6 +16010,9 @@ $.fn.progress = function(parameters) {
15904
16010
  }
15905
16011
  else {
15906
16012
  module.remove.active();
16013
+ module.remove.warning();
16014
+ module.remove.error();
16015
+ module.remove.success();
15907
16016
  module.set.label(settings.text.active);
15908
16017
  }
15909
16018
  },
@@ -16330,7 +16439,7 @@ $.fn.progress.settings = {
16330
16439
  })( jQuery, window, document );
16331
16440
 
16332
16441
  /*!
16333
- * # Fomantic-UI 2.9.0-beta.19 - Slider
16442
+ * # Fomantic-UI 2.9.0-beta.190 - Slider
16334
16443
  * http://github.com/fomantic/Fomantic-UI/
16335
16444
  *
16336
16445
  *
@@ -17669,7 +17778,7 @@ $.fn.slider.settings = {
17669
17778
  })( jQuery, window, document );
17670
17779
 
17671
17780
  /*!
17672
- * # Fomantic-UI 2.9.0-beta.19 - Rating
17781
+ * # Fomantic-UI 2.9.0-beta.190 - Rating
17673
17782
  * http://github.com/fomantic/Fomantic-UI/
17674
17783
  *
17675
17784
  *
@@ -18224,7 +18333,7 @@ $.fn.rating.settings = {
18224
18333
  })( jQuery, window, document );
18225
18334
 
18226
18335
  /*!
18227
- * # Fomantic-UI 2.9.0-beta.19 - Search
18336
+ * # Fomantic-UI 2.9.0-beta.190 - Search
18228
18337
  * http://github.com/fomantic/Fomantic-UI/
18229
18338
  *
18230
18339
  *
@@ -19792,7 +19901,7 @@ $.fn.search.settings = {
19792
19901
  })( jQuery, window, document );
19793
19902
 
19794
19903
  /*!
19795
- * # Fomantic-UI 2.9.0-beta.19 - Shape
19904
+ * # Fomantic-UI 2.9.0-beta.190 - Shape
19796
19905
  * http://github.com/fomantic/Fomantic-UI/
19797
19906
  *
19798
19907
  *
@@ -20641,7 +20750,7 @@ $.fn.shape.settings = {
20641
20750
  })( jQuery, window, document );
20642
20751
 
20643
20752
  /*!
20644
- * # Fomantic-UI 2.9.0-beta.19 - Sidebar
20753
+ * # Fomantic-UI 2.9.0-beta.190 - Sidebar
20645
20754
  * http://github.com/fomantic/Fomantic-UI/
20646
20755
  *
20647
20756
  *
@@ -21678,7 +21787,7 @@ $.fn.sidebar.settings = {
21678
21787
  })( jQuery, window, document );
21679
21788
 
21680
21789
  /*!
21681
- * # Fomantic-UI 2.9.0-beta.19 - Sticky
21790
+ * # Fomantic-UI 2.9.0-beta.190 - Sticky
21682
21791
  * http://github.com/fomantic/Fomantic-UI/
21683
21792
  *
21684
21793
  *
@@ -22636,7 +22745,7 @@ $.fn.sticky.settings = {
22636
22745
  })( jQuery, window, document );
22637
22746
 
22638
22747
  /*!
22639
- * # Fomantic-UI 2.9.0-beta.19 - Tab
22748
+ * # Fomantic-UI 2.9.0-beta.190 - Tab
22640
22749
  * http://github.com/fomantic/Fomantic-UI/
22641
22750
  *
22642
22751
  *
@@ -22737,10 +22846,18 @@ $.fn.tab = function(parameters) {
22737
22846
  initializedHistory = true;
22738
22847
  }
22739
22848
 
22740
- if(settings.autoTabActivation && instance === undefined && module.determine.activeTab() == null) {
22741
- module.debug('No active tab detected, setting first tab active', module.get.initialPath());
22742
- module.changeTab(settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation);
22743
- };
22849
+ var activeTab = module.determine.activeTab();
22850
+ if(settings.autoTabActivation && instance === undefined && activeTab == null) {
22851
+ activeTab = settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation;
22852
+ module.debug('No active tab detected, setting tab active', activeTab);
22853
+ module.changeTab(activeTab);
22854
+ }
22855
+ if(activeTab != null && settings.history) {
22856
+ var autoUpdate = $.address.autoUpdate();
22857
+ $.address.autoUpdate(false);
22858
+ $.address.value(activeTab);
22859
+ $.address.autoUpdate(autoUpdate);
22860
+ }
22744
22861
 
22745
22862
  module.instantiate();
22746
22863
  },
@@ -22840,6 +22957,7 @@ $.fn.tab = function(parameters) {
22840
22957
  .history(true)
22841
22958
  .state(settings.path)
22842
22959
  ;
22960
+ $(window).trigger('popstate');
22843
22961
  }
22844
22962
  else {
22845
22963
  module.error(error.path);
@@ -23007,6 +23125,10 @@ $.fn.tab = function(parameters) {
23007
23125
  module.verbose('Tab parameters found', nextPathArray);
23008
23126
  }
23009
23127
  }
23128
+ if (settings.onBeforeChange.call(element, currentPath) === false) {
23129
+ module.debug('onBeforeChange returned false, cancelling tab change', $tab);
23130
+ return false;
23131
+ }
23010
23132
  if(isLastTab && remoteContent) {
23011
23133
  if(!shouldIgnoreLoad) {
23012
23134
  module.activate.navigation(currentPath);
@@ -23043,6 +23165,10 @@ $.fn.tab = function(parameters) {
23043
23165
  // if anchor exists use parent tab
23044
23166
  if($anchor && $anchor.length > 0 && currentPath) {
23045
23167
  module.debug('Anchor link used, opening parent tab', $tab, $anchor);
23168
+ if (settings.onBeforeChange.call(element, currentPath) === false) {
23169
+ module.debug('onBeforeChange returned false, cancelling tab change', $tab);
23170
+ return false;
23171
+ }
23046
23172
  if( !$tab.hasClass(className.active) ) {
23047
23173
  setTimeout(function() {
23048
23174
  module.scrollTo($anchor);
@@ -23596,6 +23722,7 @@ $.fn.tab.settings = {
23596
23722
  onLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
23597
23723
  onVisible : function(tabPath, parameterArray, historyEvent) {}, // called every time tab visible
23598
23724
  onRequest : function(tabPath, parameterArray, historyEvent) {}, // called ever time a tab beings loading remote content
23725
+ onBeforeChange: function(tabPath) {}, // called before a tab is about to be changed. Returning false will cancel the tab change
23599
23726
 
23600
23727
  templates : {
23601
23728
  determineTitle: function(tabArray) {} // returns page title for path
@@ -23638,7 +23765,7 @@ $.fn.tab.settings = {
23638
23765
  })( jQuery, window, document );
23639
23766
 
23640
23767
  /*!
23641
- * # Fomantic-UI 2.9.0-beta.19 - Toast
23768
+ * # Fomantic-UI 2.9.0-beta.190 - Toast
23642
23769
  * http://github.com/fomantic/Fomantic-UI/
23643
23770
  *
23644
23771
  *
@@ -23708,12 +23835,14 @@ $.fn.toast = function(parameters) {
23708
23835
  element = this,
23709
23836
  instance = isToastComponent ? $module.data(moduleNamespace) : undefined,
23710
23837
 
23838
+ id,
23711
23839
  module
23712
23840
  ;
23713
23841
  module = {
23714
23842
 
23715
23843
  initialize: function() {
23716
23844
  module.verbose('Initializing element');
23845
+ module.create.id();
23717
23846
  if (!module.has.container()) {
23718
23847
  module.create.container();
23719
23848
  }
@@ -23763,17 +23892,22 @@ $.fn.toast = function(parameters) {
23763
23892
  },
23764
23893
 
23765
23894
  show: function(callback) {
23766
- callback = callback || function(){};
23767
- module.debug('Showing toast');
23768
23895
  if(settings.onShow.call($toastBox, element) === false) {
23769
23896
  module.debug('onShow callback returned false, cancelling toast animation');
23770
23897
  return;
23771
23898
  }
23899
+ callback = callback || function(){};
23900
+ module.debug('Showing toast');
23772
23901
  module.animate.show(callback);
23773
23902
  },
23774
23903
 
23775
23904
  close: function(callback) {
23905
+ if(settings.onHide.call($toastBox, element) === false) {
23906
+ module.debug('onHide callback returned false, cancelling toast animation');
23907
+ return;
23908
+ }
23776
23909
  callback = callback || function(){};
23910
+ module.debug('Closing toast');
23777
23911
  module.remove.visible();
23778
23912
  module.unbind.events();
23779
23913
  module.animate.close(callback);
@@ -23785,12 +23919,16 @@ $.fn.toast = function(parameters) {
23785
23919
  module.verbose('Creating container');
23786
23920
  $context.append($('<div/>',{class: settings.position + ' ' + className.container + ' ' +(settings.horizontal ? className.horizontal : '')}));
23787
23921
  },
23922
+ id: function() {
23923
+ id = (Math.random().toString(16) + '000000000').substr(2, 8);
23924
+ module.verbose('Creating unique id for element', id);
23925
+ },
23788
23926
  toast: function() {
23789
23927
  $toastBox = $('<div/>', {class: className.box});
23790
23928
  var iconClass = module.get.iconClass();
23791
23929
  if (!isToastComponent) {
23792
23930
  module.verbose('Creating toast');
23793
- $toast = $('<div/>');
23931
+ $toast = $('<div/>', {role: 'alert'});
23794
23932
  var $content = $('<div/>', {class: className.content});
23795
23933
  if (iconClass !== '') {
23796
23934
  $toast.append($('<i/>', {class: iconClass + ' ' + className.icon}));
@@ -23803,13 +23941,21 @@ $.fn.toast = function(parameters) {
23803
23941
  }));
23804
23942
  }
23805
23943
  if (settings.title !== '') {
23944
+ var titleId = '_' + module.get.id() + 'title';
23945
+ $toast.attr('aria-labelledby', titleId);
23806
23946
  $content.append($('<div/>', {
23807
23947
  class: className.title,
23808
- text: settings.title
23948
+ id: titleId,
23949
+ html: module.helpers.escape(settings.title, settings.preserveHTML)
23809
23950
  }));
23810
23951
  }
23811
-
23812
- $content.append($('<div/>', {class: className.message, html: module.helpers.escape(settings.message, settings.preserveHTML)}));
23952
+ var descId = '_' + module.get.id() + 'desc';
23953
+ $toast.attr('aria-describedby', descId);
23954
+ $content.append($('<div/>', {
23955
+ class: className.message,
23956
+ id: descId,
23957
+ html: module.helpers.escape(settings.message, settings.preserveHTML)
23958
+ }));
23813
23959
 
23814
23960
  $toast
23815
23961
  .addClass(settings.class + ' ' + className.toast)
@@ -23817,7 +23963,7 @@ $.fn.toast = function(parameters) {
23817
23963
  ;
23818
23964
  $toast.css('opacity', settings.opacity);
23819
23965
  if (settings.closeIcon) {
23820
- $close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : '')});
23966
+ $close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : ''), role: 'button', tabindex: 0, 'aria-label': settings.text.close});
23821
23967
  if($close.hasClass(className.left)) {
23822
23968
  $toast.prepend($close);
23823
23969
  } else {
@@ -23860,15 +24006,17 @@ $.fn.toast = function(parameters) {
23860
24006
  }
23861
24007
  }
23862
24008
  settings.actions.forEach(function (el) {
23863
- var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
24009
+ var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
23864
24010
  text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
23865
24011
  cls = module.helpers.deQuote(el[fields.class] || ''),
23866
24012
  click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
23867
24013
  $actions.append($('<button/>', {
23868
24014
  html: icon + text,
24015
+ 'aria-label': $('<div>'+(el[fields.text] || el[fields.icon] || '')+'</div>').text(),
23869
24016
  class: className.button + ' ' + cls,
23870
24017
  click: function () {
23871
- if (click.call(element, $module) === false) {
24018
+ var button = $(this);
24019
+ if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
23872
24020
  return;
23873
24021
  }
23874
24022
  module.close();
@@ -23968,13 +24116,12 @@ $.fn.toast = function(parameters) {
23968
24116
  bind: {
23969
24117
  events: function() {
23970
24118
  module.debug('Binding events to toast');
23971
- if(settings.closeOnClick || settings.closeIcon) {
23972
- (settings.closeIcon ? $close : $toast)
23973
- .on('click' + eventNamespace, module.event.click)
23974
- ;
24119
+ if(settings.closeIcon) {
24120
+ $close.on('click' + eventNamespace, module.event.close);
23975
24121
  }
24122
+ $toast.on('click' + eventNamespace, module.event.click);
23976
24123
  if($animationObject) {
23977
- $animationObject.on('animationend' + eventNamespace, module.close);
24124
+ $animationObject.on('animationend' + eventNamespace, module.event.close);
23978
24125
  }
23979
24126
  $toastBox
23980
24127
  .on('click' + eventNamespace, selector.approve, module.event.approve)
@@ -23986,11 +24133,10 @@ $.fn.toast = function(parameters) {
23986
24133
  unbind: {
23987
24134
  events: function() {
23988
24135
  module.debug('Unbinding events to toast');
23989
- if(settings.closeOnClick || settings.closeIcon) {
23990
- (settings.closeIcon ? $close : $toast)
23991
- .off('click' + eventNamespace)
23992
- ;
24136
+ if(settings.closeIcon) {
24137
+ $close.off('click' + eventNamespace);
23993
24138
  }
24139
+ $toast.off('click' + eventNamespace);
23994
24140
  if($animationObject) {
23995
24141
  $animationObject.off('animationend' + eventNamespace);
23996
24142
  }
@@ -24022,11 +24168,6 @@ $.fn.toast = function(parameters) {
24022
24168
  },
24023
24169
  close: function(callback) {
24024
24170
  callback = $.isFunction(callback) ? callback : function(){};
24025
- module.debug('Closing toast');
24026
- if(settings.onHide.call($toastBox, element) === false) {
24027
- module.debug('onHide callback returned false, cancelling toast animation');
24028
- return;
24029
- }
24030
24171
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
24031
24172
  $toastBox
24032
24173
  .transition({
@@ -24082,7 +24223,7 @@ $.fn.toast = function(parameters) {
24082
24223
  has: {
24083
24224
  container: function() {
24084
24225
  module.verbose('Determining if there is already a container');
24085
- return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : '')).length > 0);
24226
+ return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not('+module.helpers.toClass(className.horizontal)+')')).length > 0);
24086
24227
  },
24087
24228
  toast: function(){
24088
24229
  return !!module.get.toast();
@@ -24096,8 +24237,11 @@ $.fn.toast = function(parameters) {
24096
24237
  },
24097
24238
 
24098
24239
  get: {
24240
+ id: function() {
24241
+ return id;
24242
+ },
24099
24243
  container: function() {
24100
- return ($context.find(module.helpers.toClass(settings.position) + selector.container)[0]);
24244
+ return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not('+module.helpers.toClass(className.horizontal)+')'))[0]);
24101
24245
  },
24102
24246
  toastBox: function() {
24103
24247
  return $toastBox || null;
@@ -24129,9 +24273,15 @@ $.fn.toast = function(parameters) {
24129
24273
  },
24130
24274
 
24131
24275
  event: {
24276
+ close: function(){
24277
+ module.close();
24278
+ },
24132
24279
  click: function(event) {
24133
24280
  if($(event.target).closest('a').length === 0) {
24134
- settings.onClick.call($toastBox, element);
24281
+ if(settings.onClick.call($toastBox, element) === false || !settings.closeOnClick) {
24282
+ module.verbose('Click callback returned false or close denied by setting cancelling close');
24283
+ return;
24284
+ }
24135
24285
  module.close();
24136
24286
  }
24137
24287
  },
@@ -24472,6 +24622,10 @@ $.fn.toast.settings = {
24472
24622
  unclickable : 'unclickable'
24473
24623
  },
24474
24624
 
24625
+ text: {
24626
+ close : 'Close'
24627
+ },
24628
+
24475
24629
  icons : {
24476
24630
  info : 'info',
24477
24631
  success : 'checkmark',
@@ -24531,7 +24685,7 @@ $.extend( $.easing, {
24531
24685
  })( jQuery, window, document );
24532
24686
 
24533
24687
  /*!
24534
- * # Fomantic-UI 2.9.0-beta.19 - Transition
24688
+ * # Fomantic-UI 2.9.0-beta.190 - Transition
24535
24689
  * http://github.com/fomantic/Fomantic-UI/
24536
24690
  *
24537
24691
  *
@@ -25641,7 +25795,7 @@ $.fn.transition.settings = {
25641
25795
  })( jQuery, window, document );
25642
25796
 
25643
25797
  /*!
25644
- * # Fomantic-UI 2.9.0-beta.19 - API
25798
+ * # Fomantic-UI 2.9.0-beta.190 - API
25645
25799
  * http://github.com/fomantic/Fomantic-UI/
25646
25800
  *
25647
25801
  *
@@ -25716,6 +25870,7 @@ $.api = $.fn.api = function(parameters) {
25716
25870
  url,
25717
25871
  data,
25718
25872
  requestStartTime,
25873
+ originalData,
25719
25874
 
25720
25875
  // standard module
25721
25876
  element = this,
@@ -25728,6 +25883,7 @@ $.api = $.fn.api = function(parameters) {
25728
25883
 
25729
25884
  initialize: function() {
25730
25885
  if(!methodInvoked) {
25886
+ originalData = settings.data;
25731
25887
  module.bind.events();
25732
25888
  }
25733
25889
  module.instantiate();
@@ -25790,8 +25946,8 @@ $.api = $.fn.api = function(parameters) {
25790
25946
  module.error(error.noStorage);
25791
25947
  return;
25792
25948
  }
25793
- response = sessionStorage.getItem(url);
25794
- module.debug('Using cached response', url, response);
25949
+ response = sessionStorage.getItem(url + module.get.normalizedData());
25950
+ module.debug('Using cached response', url, settings.data, response);
25795
25951
  response = module.decode.json(response);
25796
25952
  return response;
25797
25953
  }
@@ -25809,8 +25965,8 @@ $.api = $.fn.api = function(parameters) {
25809
25965
  if( $.isPlainObject(response) ) {
25810
25966
  response = JSON.stringify(response);
25811
25967
  }
25812
- sessionStorage.setItem(url, response);
25813
- module.verbose('Storing cached response for url', url, response);
25968
+ sessionStorage.setItem(url + module.get.normalizedData(), response);
25969
+ module.verbose('Storing cached response for url', url, settings.data, response);
25814
25970
  }
25815
25971
  },
25816
25972
 
@@ -25839,7 +25995,7 @@ $.api = $.fn.api = function(parameters) {
25839
25995
 
25840
25996
  // Add form content
25841
25997
  if(settings.serializeForm) {
25842
- settings.data = module.add.formData(settings.data);
25998
+ settings.data = module.add.formData(originalData || settings.data);
25843
25999
  }
25844
26000
 
25845
26001
  // call beforesend and get any settings changes
@@ -25976,10 +26132,6 @@ $.api = $.fn.api = function(parameters) {
25976
26132
  cancelled: function() {
25977
26133
  return (module.cancelled || false);
25978
26134
  },
25979
- succesful: function() {
25980
- module.verbose('This behavior will be deleted due to typo. Use "was successful" instead.');
25981
- return module.was.successful();
25982
- },
25983
26135
  successful: function() {
25984
26136
  return (module.request && module.request.state() == 'resolved');
25985
26137
  },
@@ -26071,25 +26223,29 @@ $.api = $.fn.api = function(parameters) {
26071
26223
  },
26072
26224
  formData: function(data) {
26073
26225
  var
26074
- canSerialize = ($.fn.serializeObject !== undefined),
26075
- formData = (canSerialize)
26076
- ? $form.serializeObject()
26077
- : $form.serialize(),
26226
+ formData = {},
26078
26227
  hasOtherData
26079
26228
  ;
26080
- data = data || settings.data;
26229
+ data = data || originalData || settings.data;
26081
26230
  hasOtherData = $.isPlainObject(data);
26082
26231
 
26083
- if(hasOtherData) {
26084
- if(canSerialize) {
26085
- module.debug('Extending existing data with form data', data, formData);
26086
- data = $.extend(true, {}, data, formData);
26087
- }
26088
- else {
26089
- module.error(error.missingSerialize);
26090
- module.debug('Cant extend data. Replacing data with form data', data, formData);
26091
- data = formData;
26232
+ $.each($form.serializeArray(), function (i, element) {
26233
+ var node = formData[element.name];
26234
+
26235
+ if ('undefined' !== typeof node && node !== null) {
26236
+ if (Array.isArray(node)) {
26237
+ node.push(element.value);
26238
+ } else {
26239
+ formData[element.name] = [node, element.value];
26240
+ }
26241
+ } else {
26242
+ formData[element.name] = element.value;
26092
26243
  }
26244
+ });
26245
+
26246
+ if(hasOtherData) {
26247
+ module.debug('Extending existing data with form data', data, formData);
26248
+ data = $.extend(true, {}, data, formData);
26093
26249
  }
26094
26250
  else {
26095
26251
  module.debug('Adding form data', formData);
@@ -26340,6 +26496,9 @@ $.api = $.fn.api = function(parameters) {
26340
26496
  },
26341
26497
 
26342
26498
  get: {
26499
+ normalizedData: function(){
26500
+ return typeof settings.data === "string" ? settings.data : JSON.stringify(settings.data, Object.keys(settings.data).sort());
26501
+ },
26343
26502
  responseFromXHR: function(xhr) {
26344
26503
  return $.isPlainObject(xhr)
26345
26504
  ? (module.is.expectingJSON())
@@ -26783,7 +26942,6 @@ $.api.settings = {
26783
26942
  legacyParameters : 'You are using legacy API success callback names',
26784
26943
  method : 'The method you called is not defined',
26785
26944
  missingAction : 'API action used but no url was defined',
26786
- missingSerialize : 'jquery-serialize-object is required to add form data to an existing data object',
26787
26945
  missingURL : 'No URL specified for api event',
26788
26946
  noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
26789
26947
  noStorage : 'Caching responses locally requires session storage',
@@ -26819,7 +26977,7 @@ $.api.settings = {
26819
26977
  })( jQuery, window, document );
26820
26978
 
26821
26979
  /*!
26822
- * # Fomantic-UI 2.9.0-beta.19 - State
26980
+ * # Fomantic-UI 2.9.0-beta.190 - State
26823
26981
  * http://github.com/fomantic/Fomantic-UI/
26824
26982
  *
26825
26983
  *
@@ -27531,7 +27689,7 @@ $.fn.state.settings = {
27531
27689
  })( jQuery, window, document );
27532
27690
 
27533
27691
  /*!
27534
- * # Fomantic-UI 2.9.0-beta.19 - Visibility
27692
+ * # Fomantic-UI 2.9.0-beta.190 - Visibility
27535
27693
  * http://github.com/fomantic/Fomantic-UI/
27536
27694
  *
27537
27695
  *