fomantic-ui 2.9.3-beta.2 → 2.9.3-beta.4

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 (165) hide show
  1. package/dist/components/accordion.css +1 -1
  2. package/dist/components/accordion.js +1 -1
  3. package/dist/components/accordion.min.css +1 -1
  4. package/dist/components/accordion.min.js +1 -1
  5. package/dist/components/ad.css +1 -1
  6. package/dist/components/ad.min.css +1 -1
  7. package/dist/components/api.js +1 -1
  8. package/dist/components/api.min.js +1 -1
  9. package/dist/components/breadcrumb.css +1 -1
  10. package/dist/components/breadcrumb.min.css +1 -1
  11. package/dist/components/button.css +1 -1
  12. package/dist/components/button.min.css +1 -1
  13. package/dist/components/calendar.css +6 -6
  14. package/dist/components/calendar.js +1 -1
  15. package/dist/components/calendar.min.css +2 -2
  16. package/dist/components/calendar.min.js +1 -1
  17. package/dist/components/card.css +1 -1
  18. package/dist/components/card.min.css +1 -1
  19. package/dist/components/checkbox.css +1 -1
  20. package/dist/components/checkbox.js +1 -1
  21. package/dist/components/checkbox.min.css +1 -1
  22. package/dist/components/checkbox.min.js +1 -1
  23. package/dist/components/comment.css +1 -1
  24. package/dist/components/comment.min.css +1 -1
  25. package/dist/components/container.css +1 -1
  26. package/dist/components/container.min.css +1 -1
  27. package/dist/components/dimmer.css +1 -1
  28. package/dist/components/dimmer.js +1 -1
  29. package/dist/components/dimmer.min.css +1 -1
  30. package/dist/components/dimmer.min.js +1 -1
  31. package/dist/components/divider.css +1 -1
  32. package/dist/components/divider.min.css +1 -1
  33. package/dist/components/dropdown.css +1 -1
  34. package/dist/components/dropdown.js +11 -4
  35. package/dist/components/dropdown.min.css +1 -1
  36. package/dist/components/dropdown.min.js +2 -2
  37. package/dist/components/embed.css +1 -1
  38. package/dist/components/embed.js +1 -1
  39. package/dist/components/embed.min.css +1 -1
  40. package/dist/components/embed.min.js +1 -1
  41. package/dist/components/emoji.css +1 -1
  42. package/dist/components/emoji.min.css +1 -1
  43. package/dist/components/feed.css +1 -1
  44. package/dist/components/feed.min.css +1 -1
  45. package/dist/components/flag.css +1 -1
  46. package/dist/components/flag.min.css +1 -1
  47. package/dist/components/flyout.css +1 -1
  48. package/dist/components/flyout.js +24 -20
  49. package/dist/components/flyout.min.css +1 -1
  50. package/dist/components/flyout.min.js +2 -2
  51. package/dist/components/form.css +1 -1
  52. package/dist/components/form.js +26 -18
  53. package/dist/components/form.min.css +1 -1
  54. package/dist/components/form.min.js +2 -2
  55. package/dist/components/grid.css +1 -1
  56. package/dist/components/grid.min.css +1 -1
  57. package/dist/components/header.css +1 -1
  58. package/dist/components/header.min.css +1 -1
  59. package/dist/components/icon.css +1 -1
  60. package/dist/components/icon.min.css +1 -1
  61. package/dist/components/image.css +1 -1
  62. package/dist/components/image.min.css +1 -1
  63. package/dist/components/input.css +1 -1
  64. package/dist/components/input.min.css +1 -1
  65. package/dist/components/item.css +1 -1
  66. package/dist/components/item.min.css +1 -1
  67. package/dist/components/label.css +1 -1
  68. package/dist/components/label.min.css +1 -1
  69. package/dist/components/list.css +1 -1
  70. package/dist/components/list.min.css +1 -1
  71. package/dist/components/loader.css +1 -1
  72. package/dist/components/loader.min.css +1 -1
  73. package/dist/components/menu.css +1 -1
  74. package/dist/components/menu.min.css +1 -1
  75. package/dist/components/message.css +1 -1
  76. package/dist/components/message.min.css +1 -1
  77. package/dist/components/modal.css +1 -1
  78. package/dist/components/modal.js +25 -20
  79. package/dist/components/modal.min.css +1 -1
  80. package/dist/components/modal.min.js +2 -2
  81. package/dist/components/nag.css +1 -1
  82. package/dist/components/nag.js +1 -1
  83. package/dist/components/nag.min.css +1 -1
  84. package/dist/components/nag.min.js +1 -1
  85. package/dist/components/placeholder.css +1 -1
  86. package/dist/components/placeholder.min.css +1 -1
  87. package/dist/components/popup.css +1 -1
  88. package/dist/components/popup.js +1 -1
  89. package/dist/components/popup.min.css +1 -1
  90. package/dist/components/popup.min.js +1 -1
  91. package/dist/components/progress.css +1 -1
  92. package/dist/components/progress.js +1 -1
  93. package/dist/components/progress.min.css +1 -1
  94. package/dist/components/progress.min.js +1 -1
  95. package/dist/components/rail.css +1 -1
  96. package/dist/components/rail.min.css +1 -1
  97. package/dist/components/rating.css +1 -1
  98. package/dist/components/rating.js +1 -1
  99. package/dist/components/rating.min.css +1 -1
  100. package/dist/components/rating.min.js +1 -1
  101. package/dist/components/reset.css +1 -1
  102. package/dist/components/reset.min.css +1 -1
  103. package/dist/components/reveal.css +1 -1
  104. package/dist/components/reveal.min.css +1 -1
  105. package/dist/components/search.css +1 -1
  106. package/dist/components/search.js +1 -1
  107. package/dist/components/search.min.css +1 -1
  108. package/dist/components/search.min.js +1 -1
  109. package/dist/components/segment.css +1 -1
  110. package/dist/components/segment.min.css +1 -1
  111. package/dist/components/shape.css +1 -1
  112. package/dist/components/shape.js +1 -1
  113. package/dist/components/shape.min.css +1 -1
  114. package/dist/components/shape.min.js +1 -1
  115. package/dist/components/sidebar.css +1 -1
  116. package/dist/components/sidebar.js +1 -1
  117. package/dist/components/sidebar.min.css +1 -1
  118. package/dist/components/sidebar.min.js +1 -1
  119. package/dist/components/site.css +1 -1
  120. package/dist/components/site.js +1 -1
  121. package/dist/components/site.min.css +1 -1
  122. package/dist/components/site.min.js +1 -1
  123. package/dist/components/slider.css +1 -1
  124. package/dist/components/slider.js +1 -1
  125. package/dist/components/slider.min.css +1 -1
  126. package/dist/components/slider.min.js +1 -1
  127. package/dist/components/state.js +1 -1
  128. package/dist/components/state.min.js +1 -1
  129. package/dist/components/statistic.css +1 -1
  130. package/dist/components/statistic.min.css +1 -1
  131. package/dist/components/step.css +1 -1
  132. package/dist/components/step.min.css +1 -1
  133. package/dist/components/sticky.css +1 -1
  134. package/dist/components/sticky.js +1 -1
  135. package/dist/components/sticky.min.css +1 -1
  136. package/dist/components/sticky.min.js +1 -1
  137. package/dist/components/tab.css +1 -1
  138. package/dist/components/tab.js +1 -1
  139. package/dist/components/tab.min.css +1 -1
  140. package/dist/components/tab.min.js +1 -1
  141. package/dist/components/table.css +1 -1
  142. package/dist/components/table.min.css +1 -1
  143. package/dist/components/text.css +1 -1
  144. package/dist/components/text.min.css +1 -1
  145. package/dist/components/toast.css +1 -1
  146. package/dist/components/toast.js +2 -2
  147. package/dist/components/toast.min.css +1 -1
  148. package/dist/components/toast.min.js +2 -2
  149. package/dist/components/transition.css +1 -1
  150. package/dist/components/transition.js +1 -1
  151. package/dist/components/transition.min.css +1 -1
  152. package/dist/components/transition.min.js +1 -1
  153. package/dist/components/visibility.js +1 -1
  154. package/dist/components/visibility.min.js +1 -1
  155. package/dist/semantic.css +58 -58
  156. package/dist/semantic.js +109 -85
  157. package/dist/semantic.min.css +2 -2
  158. package/dist/semantic.min.js +2 -2
  159. package/package.json +1 -1
  160. package/src/definitions/behaviors/form.js +25 -17
  161. package/src/definitions/modules/calendar.less +1 -1
  162. package/src/definitions/modules/dropdown.js +10 -3
  163. package/src/definitions/modules/flyout.js +23 -19
  164. package/src/definitions/modules/modal.js +24 -19
  165. package/src/definitions/modules/toast.js +1 -1
package/dist/semantic.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.3-beta.2+824a375
2
+ * # Fomantic UI - 2.9.3-beta.4+bda537d
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * https://fomantic-ui.com/
5
5
  *
@@ -9,7 +9,7 @@
9
9
  *
10
10
  */
11
11
  /*!
12
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Site
12
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Site
13
13
  * https://github.com/fomantic/Fomantic-UI/
14
14
  *
15
15
  *
@@ -463,7 +463,7 @@
463
463
  })(jQuery, window, document);
464
464
 
465
465
  /*!
466
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Form Validation
466
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Form Validation
467
467
  * https://github.com/fomantic/Fomantic-UI/
468
468
  *
469
469
  *
@@ -486,6 +486,7 @@
486
486
  $.fn.form = function (parameters) {
487
487
  var
488
488
  $allModules = $(this),
489
+ $window = $(window),
489
490
 
490
491
  time = Date.now(),
491
492
  performance = [],
@@ -524,6 +525,8 @@
524
525
  namespace,
525
526
  moduleNamespace,
526
527
  eventNamespace,
528
+ attachEventsSelector,
529
+ attachEventsAction,
527
530
 
528
531
  submitting = false,
529
532
  dirty = false,
@@ -606,6 +609,9 @@
606
609
  module[action]();
607
610
  event.preventDefault();
608
611
  });
612
+
613
+ attachEventsSelector = selector;
614
+ attachEventsAction = action;
609
615
  },
610
616
 
611
617
  bindEvents: function () {
@@ -631,7 +637,7 @@
631
637
 
632
638
  // Dirty events
633
639
  if (settings.preventLeaving) {
634
- $(window).on('beforeunload' + eventNamespace, module.event.beforeUnload);
640
+ $window.on('beforeunload' + eventNamespace, module.event.beforeUnload);
635
641
  }
636
642
 
637
643
  $field.on('change' + eventNamespace
@@ -649,6 +655,9 @@
649
655
  $module.on('clean' + eventNamespace, function (e) {
650
656
  settings.onClean.call();
651
657
  });
658
+ if (attachEventsSelector) {
659
+ module.attachEvents(attachEventsSelector, attachEventsAction);
660
+ }
652
661
  },
653
662
 
654
663
  clear: function () {
@@ -697,6 +706,7 @@
697
706
  isCheckbox = $field.is(selector.checkbox),
698
707
  isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
699
708
  isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
709
+ isFile = $field.is(selector.file),
700
710
  isErrored = $fieldGroup.hasClass(className.error)
701
711
  ;
702
712
  if (defaultValue === undefined) {
@@ -717,7 +727,7 @@
717
727
  $calendar.calendar('set date', defaultValue);
718
728
  } else {
719
729
  module.verbose('Resetting field value', $field, defaultValue);
720
- $field.val(defaultValue);
730
+ $field.val(isFile ? '' : defaultValue);
721
731
  }
722
732
  });
723
733
  module.remove.states();
@@ -853,6 +863,13 @@
853
863
  $module.off(eventNamespace);
854
864
  $field.off(eventNamespace);
855
865
  $submit.off(eventNamespace);
866
+ if (settings.preventLeaving) {
867
+ $window.off(eventNamespace);
868
+ }
869
+ if (attachEventsSelector) {
870
+ $(attachEventsSelector).off(eventNamespace);
871
+ attachEventsSelector = undefined;
872
+ }
856
873
  },
857
874
 
858
875
  event: {
@@ -954,18 +971,7 @@
954
971
  return rule.type;
955
972
  },
956
973
  changeEvent: function (type, $input) {
957
- if (type === 'checkbox' || type === 'radio' || type === 'hidden' || $input.is('select')) {
958
- return 'change';
959
- }
960
-
961
- return module.get.inputEvent();
962
- },
963
- inputEvent: function () {
964
- return document.createElement('input').oninput !== undefined
965
- ? 'input'
966
- : (document.createElement('input').onpropertychange !== undefined
967
- ? 'propertychange'
968
- : 'keyup');
974
+ return ['file', 'checkbox', 'radio', 'hidden'].indexOf(type) >= 0 || $input.is('select') ? 'change' : 'input';
969
975
  },
970
976
  fieldsFromShorthand: function (fields) {
971
977
  var
@@ -1570,6 +1576,7 @@
1570
1576
  $field = module.get.field(key),
1571
1577
  $element = $field.parent(),
1572
1578
  $calendar = $field.closest(selector.uiCalendar),
1579
+ isFile = $field.is(selector.file),
1573
1580
  isMultiple = Array.isArray(value),
1574
1581
  isCheckbox = $element.is(selector.uiCheckbox) && module.can.useElement('checkbox'),
1575
1582
  isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
@@ -1612,7 +1619,7 @@
1612
1619
  $calendar.calendar('set date', value);
1613
1620
  } else {
1614
1621
  module.verbose('Setting field value', value, $field);
1615
- $field.val(value);
1622
+ $field.val(isFile ? '' : value);
1616
1623
  }
1617
1624
  }
1618
1625
  });
@@ -2115,9 +2122,10 @@
2115
2122
  selector: {
2116
2123
  checkbox: 'input[type="checkbox"], input[type="radio"]',
2117
2124
  clear: '.clear',
2118
- field: 'input:not(.search):not([type="file"]):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',
2125
+ field: 'input:not(.search):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',
2126
+ file: 'input[type="file"]',
2119
2127
  group: '.field',
2120
- input: 'input:not([type="file"])',
2128
+ input: 'input',
2121
2129
  message: '.error.message',
2122
2130
  prompt: '.prompt.label',
2123
2131
  radio: 'input[type="radio"]',
@@ -2569,7 +2577,7 @@
2569
2577
  })(jQuery, window, document);
2570
2578
 
2571
2579
  /*!
2572
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Accordion
2580
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Accordion
2573
2581
  * https://github.com/fomantic/Fomantic-UI/
2574
2582
  *
2575
2583
  *
@@ -3163,7 +3171,7 @@
3163
3171
  })(jQuery, window, document);
3164
3172
 
3165
3173
  /*!
3166
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Calendar
3174
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Calendar
3167
3175
  * https://github.com/fomantic/Fomantic-UI/
3168
3176
  *
3169
3177
  *
@@ -5174,7 +5182,7 @@
5174
5182
  })(jQuery, window, document);
5175
5183
 
5176
5184
  /*!
5177
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Checkbox
5185
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Checkbox
5178
5186
  * https://github.com/fomantic/Fomantic-UI/
5179
5187
  *
5180
5188
  *
@@ -6055,7 +6063,7 @@
6055
6063
  })(jQuery, window, document);
6056
6064
 
6057
6065
  /*!
6058
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Dimmer
6066
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Dimmer
6059
6067
  * https://github.com/fomantic/Fomantic-UI/
6060
6068
  *
6061
6069
  *
@@ -6786,7 +6794,7 @@
6786
6794
  })(jQuery, window, document);
6787
6795
 
6788
6796
  /*!
6789
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Dropdown
6797
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Dropdown
6790
6798
  * https://github.com/fomantic/Fomantic-UI/
6791
6799
  *
6792
6800
  *
@@ -6889,7 +6897,8 @@
6889
6897
  selectObserver,
6890
6898
  menuObserver,
6891
6899
  classObserver,
6892
- module
6900
+ module,
6901
+ tempDisableApiCache = false
6893
6902
  ;
6894
6903
 
6895
6904
  module = {
@@ -7656,11 +7665,12 @@
7656
7665
  if (!$module.api('get request')) {
7657
7666
  module.setup.api();
7658
7667
  }
7659
- apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings, apiCallbacks);
7668
+ apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings, apiCallbacks, tempDisableApiCache ? { cache: false } : {});
7660
7669
  $module
7661
7670
  .api('setting', apiSettings)
7662
7671
  .api('query')
7663
7672
  ;
7673
+ tempDisableApiCache = false;
7664
7674
  },
7665
7675
 
7666
7676
  filterItems: function (query) {
@@ -9186,6 +9196,11 @@
9186
9196
  module.set.value('', null, null, preventChangeTrigger);
9187
9197
  },
9188
9198
 
9199
+ clearCache: function () {
9200
+ module.debug('Clearing API cache once');
9201
+ tempDisableApiCache = true;
9202
+ },
9203
+
9189
9204
  scrollPage: function (direction, $selectedItem) {
9190
9205
  var
9191
9206
  $currentItem = $selectedItem || module.get.selectedItem(),
@@ -10236,7 +10251,7 @@
10236
10251
  return settings.apiSettings && module.can.useAPI();
10237
10252
  },
10238
10253
  noApiCache: function () {
10239
- return settings.apiSettings && !settings.apiSettings.cache;
10254
+ return tempDisableApiCache || (settings.apiSettings && !settings.apiSettings.cache);
10240
10255
  },
10241
10256
  single: function () {
10242
10257
  return !module.is.multiple();
@@ -11129,7 +11144,7 @@
11129
11144
  })(jQuery, window, document);
11130
11145
 
11131
11146
  /*!
11132
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Embed
11147
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Embed
11133
11148
  * https://github.com/fomantic/Fomantic-UI/
11134
11149
  *
11135
11150
  *
@@ -11808,7 +11823,7 @@
11808
11823
  })(jQuery, window, document);
11809
11824
 
11810
11825
  /*!
11811
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Flyout
11826
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Flyout
11812
11827
  * https://github.com/fomantic/Fomantic-UI/
11813
11828
  *
11814
11829
  *
@@ -11895,6 +11910,7 @@
11895
11910
  initialBodyMargin = '',
11896
11911
  tempBodyMargin = '',
11897
11912
  hadScrollbar = false,
11913
+ windowRefocused = false,
11898
11914
 
11899
11915
  elementNamespace,
11900
11916
  id,
@@ -12073,9 +12089,13 @@
12073
12089
  module.setup.heights();
12074
12090
  },
12075
12091
  focus: function () {
12076
- if (module.is.visible() && settings.autofocus && settings.dimPage) {
12092
+ windowRefocused = true;
12093
+ },
12094
+ click: function (event) {
12095
+ if (windowRefocused && document.activeElement !== event.target && module.is.visible() && settings.autofocus && settings.dimPage && $(document.activeElement).closest(selector.flyout).length === 0) {
12077
12096
  requestAnimationFrame(module.set.autofocus);
12078
12097
  }
12098
+ windowRefocused = false;
12079
12099
  },
12080
12100
  clickaway: function (event) {
12081
12101
  if (settings.closable) {
@@ -12182,6 +12202,9 @@
12182
12202
  $window
12183
12203
  .on('focus' + elementNamespace, module.event.focus)
12184
12204
  ;
12205
+ $context
12206
+ .on('click' + elementNamespace, module.event.click)
12207
+ ;
12185
12208
  },
12186
12209
  clickaway: function () {
12187
12210
  module.verbose('Adding clickaway events to context', $context);
@@ -12311,11 +12334,12 @@
12311
12334
 
12312
12335
  return nodes;
12313
12336
  },
12314
- shouldRefreshInputs = false
12337
+ shouldRefreshInputs = false,
12338
+ ignoreAutofocus = true
12315
12339
  ;
12316
12340
  mutations.every(function (mutation) {
12317
12341
  if (mutation.type === 'attributes') {
12318
- if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').length > 0)) {
12342
+ if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').filter(':visible').length > 0)) {
12319
12343
  shouldRefreshInputs = true;
12320
12344
  }
12321
12345
  } else {
@@ -12325,6 +12349,7 @@
12325
12349
  $removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
12326
12350
  if ($addedInputs.length > 0 || $removedInputs.length > 0) {
12327
12351
  shouldRefreshInputs = true;
12352
+ ignoreAutofocus = false;
12328
12353
  }
12329
12354
  }
12330
12355
 
@@ -12332,7 +12357,7 @@
12332
12357
  });
12333
12358
 
12334
12359
  if (shouldRefreshInputs) {
12335
- module.refreshInputs();
12360
+ module.refreshInputs(ignoreAutofocus);
12336
12361
  }
12337
12362
  });
12338
12363
  observer.observe(element, {
@@ -12357,7 +12382,7 @@
12357
12382
  $flyouts = $context.children(selector.flyout);
12358
12383
  },
12359
12384
 
12360
- refreshInputs: function () {
12385
+ refreshInputs: function (ignoreAutofocus) {
12361
12386
  if ($inputs) {
12362
12387
  $inputs
12363
12388
  .off('keydown' + elementNamespace)
@@ -12369,8 +12394,8 @@
12369
12394
  $inputs = $module.find('a[href], [tabindex], :input:enabled').filter(':visible').filter(function () {
12370
12395
  return $(this).closest('.disabled').length === 0;
12371
12396
  });
12372
- if ($inputs.length === 0) {
12373
- $inputs = $module;
12397
+ if ($inputs.filter(':input').length === 0) {
12398
+ $inputs = $module.add($inputs);
12374
12399
  $module.attr('tabindex', -1);
12375
12400
  } else {
12376
12401
  $module.removeAttr('tabindex');
@@ -12381,7 +12406,7 @@
12381
12406
  $inputs.last()
12382
12407
  .on('keydown' + elementNamespace, module.event.inputKeyDown.last)
12383
12408
  ;
12384
- if (settings.autofocus && $inputs.filter(':focus').length === 0) {
12409
+ if (!ignoreAutofocus && settings.autofocus && $inputs.filter(':focus').length === 0) {
12385
12410
  module.set.autofocus();
12386
12411
  }
12387
12412
  },
@@ -12659,20 +12684,14 @@
12659
12684
  var
12660
12685
  $autofocus = $inputs.filter('[autofocus]'),
12661
12686
  $rawInputs = $inputs.filter(':input'),
12662
- $input = $autofocus.length > 0
12663
- ? $autofocus.first()
12687
+ $input = ($autofocus.length > 0
12688
+ ? $autofocus
12664
12689
  : ($rawInputs.length > 0
12665
12690
  ? $rawInputs
12666
- : $inputs.filter(':not(i.close)')
12667
- ).first()
12691
+ : $module)
12692
+ ).first()
12668
12693
  ;
12669
- // check if only the close icon is remaining
12670
- if ($input.length === 0 && $inputs.length > 0) {
12671
- $input = $inputs.first();
12672
- }
12673
- if ($input.length > 0) {
12674
- $input.trigger('focus');
12675
- }
12694
+ $input.trigger('focus');
12676
12695
  },
12677
12696
  dimmerStyles: function () {
12678
12697
  if (settings.blurring) {
@@ -13383,7 +13402,7 @@
13383
13402
  })(jQuery, window, document);
13384
13403
 
13385
13404
  /*!
13386
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Modal
13405
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Modal
13387
13406
  * https://github.com/fomantic/Fomantic-UI/
13388
13407
  *
13389
13408
  *
@@ -13472,6 +13491,7 @@
13472
13491
  tempBodyMargin = '',
13473
13492
  keepScrollingClass = false,
13474
13493
  hadScrollbar = false,
13494
+ windowRefocused = false,
13475
13495
 
13476
13496
  elementEventNamespace,
13477
13497
  id,
@@ -13635,6 +13655,7 @@
13635
13655
  .off(eventNamespace)
13636
13656
  ;
13637
13657
  $window.off(elementEventNamespace);
13658
+ $context.off(elementEventNamespace);
13638
13659
  $dimmer.off(elementEventNamespace);
13639
13660
  $closeIcon.off(elementEventNamespace);
13640
13661
  if ($inputs) {
@@ -13656,11 +13677,12 @@
13656
13677
  return nodes;
13657
13678
  },
13658
13679
  shouldRefresh = false,
13659
- shouldRefreshInputs = false
13680
+ shouldRefreshInputs = false,
13681
+ ignoreAutofocus = true
13660
13682
  ;
13661
13683
  mutations.every(function (mutation) {
13662
13684
  if (mutation.type === 'attributes') {
13663
- if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').length > 0)) {
13685
+ if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').filter(':visible').length > 0)) {
13664
13686
  shouldRefreshInputs = true;
13665
13687
  }
13666
13688
  } else {
@@ -13671,6 +13693,7 @@
13671
13693
  $removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
13672
13694
  if ($addedInputs.length > 0 || $removedInputs.length > 0) {
13673
13695
  shouldRefreshInputs = true;
13696
+ ignoreAutofocus = false;
13674
13697
  }
13675
13698
  }
13676
13699
 
@@ -13682,7 +13705,7 @@
13682
13705
  module.refresh();
13683
13706
  }
13684
13707
  if (shouldRefreshInputs) {
13685
- module.refreshInputs();
13708
+ module.refreshInputs(ignoreAutofocus);
13686
13709
  }
13687
13710
  });
13688
13711
  observer.observe(element, {
@@ -13710,7 +13733,7 @@
13710
13733
  $allModals = $otherModals.add($module);
13711
13734
  },
13712
13735
 
13713
- refreshInputs: function () {
13736
+ refreshInputs: function (ignoreAutofocus) {
13714
13737
  if ($inputs) {
13715
13738
  $inputs
13716
13739
  .off('keydown' + elementEventNamespace)
@@ -13719,8 +13742,8 @@
13719
13742
  $inputs = $module.find('a[href], [tabindex], :input:enabled').filter(':visible').filter(function () {
13720
13743
  return $(this).closest('.disabled').length === 0;
13721
13744
  });
13722
- if ($inputs.length === 0) {
13723
- $inputs = $module;
13745
+ if ($inputs.filter(':input').length === 0) {
13746
+ $inputs = $module.add($inputs);
13724
13747
  $module.attr('tabindex', -1);
13725
13748
  } else {
13726
13749
  $module.removeAttr('tabindex');
@@ -13731,7 +13754,7 @@
13731
13754
  $inputs.last()
13732
13755
  .on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
13733
13756
  ;
13734
- if (settings.autofocus && $inputs.filter(':focus').length === 0) {
13757
+ if (!ignoreAutofocus && settings.autofocus && $inputs.filter(':focus').length === 0) {
13735
13758
  module.set.autofocus();
13736
13759
  }
13737
13760
  },
@@ -13769,6 +13792,9 @@
13769
13792
  .on('resize' + elementEventNamespace, module.event.resize)
13770
13793
  .on('focus' + elementEventNamespace, module.event.focus)
13771
13794
  ;
13795
+ $context
13796
+ .on('click' + elementEventNamespace, module.event.click)
13797
+ ;
13772
13798
  },
13773
13799
  scrollLock: function () {
13774
13800
  // touch events default to passive, due to changes in chrome to optimize mobile perf
@@ -13926,9 +13952,13 @@
13926
13952
  }
13927
13953
  },
13928
13954
  focus: function () {
13929
- if ($dimmable.dimmer('is active') && module.is.active() && settings.autofocus) {
13955
+ windowRefocused = true;
13956
+ },
13957
+ click: function (event) {
13958
+ if (windowRefocused && document.activeElement !== event.target && $dimmable.dimmer('is active') && module.is.active() && settings.autofocus && $(document.activeElement).closest(selector.modal).length === 0) {
13930
13959
  requestAnimationFrame(module.set.autofocus);
13931
13960
  }
13961
+ windowRefocused = false;
13932
13962
  },
13933
13963
  },
13934
13964
 
@@ -14438,20 +14468,14 @@
14438
14468
  var
14439
14469
  $autofocus = $inputs.filter('[autofocus]'),
14440
14470
  $rawInputs = $inputs.filter(':input'),
14441
- $input = $autofocus.length > 0
14442
- ? $autofocus.first()
14471
+ $input = ($autofocus.length > 0
14472
+ ? $autofocus
14443
14473
  : ($rawInputs.length > 0
14444
14474
  ? $rawInputs
14445
- : $inputs.filter(':not(i.close)')
14446
- ).first()
14475
+ : $module)
14476
+ ).first()
14447
14477
  ;
14448
- // check if only the close icon is remaining
14449
- if ($input.length === 0 && $inputs.length > 0) {
14450
- $input = $inputs.first();
14451
- }
14452
- if ($input.length > 0) {
14453
- $input.trigger('focus');
14454
- }
14478
+ $input.trigger('focus');
14455
14479
  },
14456
14480
  bodyMargin: function () {
14457
14481
  var position = module.can.leftBodyScrollbar() ? 'left' : 'right';
@@ -15012,7 +15036,7 @@
15012
15036
  })(jQuery, window, document);
15013
15037
 
15014
15038
  /*!
15015
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Nag
15039
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Nag
15016
15040
  * https://github.com/fomantic/Fomantic-UI/
15017
15041
  *
15018
15042
  *
@@ -15573,7 +15597,7 @@
15573
15597
  })(jQuery, window, document);
15574
15598
 
15575
15599
  /*!
15576
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Popup
15600
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Popup
15577
15601
  * https://github.com/fomantic/Fomantic-UI/
15578
15602
  *
15579
15603
  *
@@ -17127,7 +17151,7 @@
17127
17151
  })(jQuery, window, document);
17128
17152
 
17129
17153
  /*!
17130
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Progress
17154
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Progress
17131
17155
  * https://github.com/fomantic/Fomantic-UI/
17132
17156
  *
17133
17157
  *
@@ -18105,7 +18129,7 @@
18105
18129
  })(jQuery, window, document);
18106
18130
 
18107
18131
  /*!
18108
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Slider
18132
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Slider
18109
18133
  * https://github.com/fomantic/Fomantic-UI/
18110
18134
  *
18111
18135
  *
@@ -19453,7 +19477,7 @@
19453
19477
  })(jQuery, window, document);
19454
19478
 
19455
19479
  /*!
19456
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Rating
19480
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Rating
19457
19481
  * https://github.com/fomantic/Fomantic-UI/
19458
19482
  *
19459
19483
  *
@@ -19992,7 +20016,7 @@
19992
20016
  })(jQuery, window, document);
19993
20017
 
19994
20018
  /*!
19995
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Search
20019
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Search
19996
20020
  * https://github.com/fomantic/Fomantic-UI/
19997
20021
  *
19998
20022
  *
@@ -21569,7 +21593,7 @@
21569
21593
  })(jQuery, window, document);
21570
21594
 
21571
21595
  /*!
21572
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Shape
21596
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Shape
21573
21597
  * https://github.com/fomantic/Fomantic-UI/
21574
21598
  *
21575
21599
  *
@@ -22365,7 +22389,7 @@
22365
22389
  })(jQuery, window, document);
22366
22390
 
22367
22391
  /*!
22368
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Sidebar
22392
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Sidebar
22369
22393
  * https://github.com/fomantic/Fomantic-UI/
22370
22394
  *
22371
22395
  *
@@ -23448,7 +23472,7 @@
23448
23472
  })(jQuery, window, document);
23449
23473
 
23450
23474
  /*!
23451
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Sticky
23475
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Sticky
23452
23476
  * https://github.com/fomantic/Fomantic-UI/
23453
23477
  *
23454
23478
  *
@@ -24364,7 +24388,7 @@
24364
24388
  })(jQuery, window, document);
24365
24389
 
24366
24390
  /*!
24367
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Tab
24391
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Tab
24368
24392
  * https://github.com/fomantic/Fomantic-UI/
24369
24393
  *
24370
24394
  *
@@ -25328,7 +25352,7 @@
25328
25352
  })(jQuery, window, document);
25329
25353
 
25330
25354
  /*!
25331
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Toast
25355
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Toast
25332
25356
  * https://github.com/fomantic/Fomantic-UI/
25333
25357
  *
25334
25358
  *
@@ -25446,11 +25470,11 @@
25446
25470
  if ($toastBox) {
25447
25471
  module.debug('Removing toast', $toastBox);
25448
25472
  module.unbind.events();
25473
+ settings.onRemove.call($toastBox, element);
25449
25474
  $toastBox.remove();
25450
25475
  $toastBox = undefined;
25451
25476
  $toast = undefined;
25452
25477
  $animationObject = undefined;
25453
- settings.onRemove.call($toastBox, element);
25454
25478
  $progress = undefined;
25455
25479
  $progressBar = undefined;
25456
25480
  $close = undefined;
@@ -26289,7 +26313,7 @@
26289
26313
  })(jQuery, window, document);
26290
26314
 
26291
26315
  /*!
26292
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Transition
26316
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Transition
26293
26317
  * https://github.com/fomantic/Fomantic-UI/
26294
26318
  *
26295
26319
  *
@@ -27320,7 +27344,7 @@
27320
27344
  })(jQuery, window, document);
27321
27345
 
27322
27346
  /*!
27323
- * # Fomantic-UI 2.9.3-beta.2+824a375 - API
27347
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - API
27324
27348
  * https://github.com/fomantic/Fomantic-UI/
27325
27349
  *
27326
27350
  *
@@ -28541,7 +28565,7 @@
28541
28565
  })(jQuery, window, document);
28542
28566
 
28543
28567
  /*!
28544
- * # Fomantic-UI 2.9.3-beta.2+824a375 - State
28568
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - State
28545
28569
  * https://github.com/fomantic/Fomantic-UI/
28546
28570
  *
28547
28571
  *
@@ -29237,7 +29261,7 @@
29237
29261
  })(jQuery, window, document);
29238
29262
 
29239
29263
  /*!
29240
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Visibility
29264
+ * # Fomantic-UI 2.9.3-beta.4+bda537d - Visibility
29241
29265
  * https://github.com/fomantic/Fomantic-UI/
29242
29266
  *
29243
29267
  *