fomantic-ui 2.9.0-beta.318 → 2.9.0-beta.319

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 (162) 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 +1 -1
  14. package/dist/components/calendar.js +1 -1
  15. package/dist/components/calendar.min.css +1 -1
  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 +1 -1
  35. package/dist/components/dropdown.min.css +1 -1
  36. package/dist/components/dropdown.min.js +1 -1
  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/feed.css +1 -1
  42. package/dist/components/feed.min.css +1 -1
  43. package/dist/components/flag.css +1 -1
  44. package/dist/components/flag.min.css +1 -1
  45. package/dist/components/flyout.css +57 -23
  46. package/dist/components/flyout.js +217 -31
  47. package/dist/components/flyout.min.css +2 -2
  48. package/dist/components/flyout.min.js +2 -2
  49. package/dist/components/form.css +1 -1
  50. package/dist/components/form.js +1 -1
  51. package/dist/components/form.min.css +1 -1
  52. package/dist/components/form.min.js +1 -1
  53. package/dist/components/grid.css +1 -1
  54. package/dist/components/grid.min.css +1 -1
  55. package/dist/components/header.css +1 -1
  56. package/dist/components/header.min.css +1 -1
  57. package/dist/components/icon.css +1 -1
  58. package/dist/components/icon.min.css +1 -1
  59. package/dist/components/image.css +1 -1
  60. package/dist/components/image.min.css +1 -1
  61. package/dist/components/input.css +1 -1
  62. package/dist/components/input.min.css +1 -1
  63. package/dist/components/item.css +1 -1
  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/message.css +1 -1
  72. package/dist/components/message.min.css +1 -1
  73. package/dist/components/modal.css +6 -6
  74. package/dist/components/modal.js +1 -1
  75. package/dist/components/modal.min.css +2 -2
  76. package/dist/components/modal.min.js +1 -1
  77. package/dist/components/nag.css +1 -1
  78. package/dist/components/nag.js +1 -1
  79. package/dist/components/nag.min.css +1 -1
  80. package/dist/components/nag.min.js +1 -1
  81. package/dist/components/placeholder.css +1 -1
  82. package/dist/components/placeholder.min.css +1 -1
  83. package/dist/components/popup.css +1 -1
  84. package/dist/components/popup.js +1 -1
  85. package/dist/components/popup.min.css +1 -1
  86. package/dist/components/popup.min.js +1 -1
  87. package/dist/components/progress.css +1 -1
  88. package/dist/components/progress.js +1 -1
  89. package/dist/components/progress.min.css +1 -1
  90. package/dist/components/progress.min.js +1 -1
  91. package/dist/components/rail.css +1 -1
  92. package/dist/components/rail.min.css +1 -1
  93. package/dist/components/rating.css +1 -1
  94. package/dist/components/rating.js +1 -1
  95. package/dist/components/rating.min.css +1 -1
  96. package/dist/components/rating.min.js +1 -1
  97. package/dist/components/reset.css +1 -1
  98. package/dist/components/reset.min.css +1 -1
  99. package/dist/components/reveal.css +1 -1
  100. package/dist/components/reveal.min.css +1 -1
  101. package/dist/components/search.css +1 -1
  102. package/dist/components/search.js +1 -1
  103. package/dist/components/search.min.css +1 -1
  104. package/dist/components/search.min.js +1 -1
  105. package/dist/components/segment.css +1 -1
  106. package/dist/components/segment.min.css +1 -1
  107. package/dist/components/shape.css +1 -1
  108. package/dist/components/shape.js +1 -1
  109. package/dist/components/shape.min.css +1 -1
  110. package/dist/components/shape.min.js +1 -1
  111. package/dist/components/sidebar.css +11 -3
  112. package/dist/components/sidebar.js +27 -7
  113. package/dist/components/sidebar.min.css +2 -2
  114. package/dist/components/sidebar.min.js +2 -2
  115. package/dist/components/site.css +1 -1
  116. package/dist/components/site.js +1 -1
  117. package/dist/components/site.min.css +1 -1
  118. package/dist/components/site.min.js +1 -1
  119. package/dist/components/slider.js +1 -1
  120. package/dist/components/slider.min.js +1 -1
  121. package/dist/components/state.js +1 -1
  122. package/dist/components/state.min.js +1 -1
  123. package/dist/components/statistic.css +1 -1
  124. package/dist/components/statistic.min.css +1 -1
  125. package/dist/components/step.css +1 -1
  126. package/dist/components/step.min.css +1 -1
  127. package/dist/components/sticky.css +1 -1
  128. package/dist/components/sticky.js +1 -1
  129. package/dist/components/sticky.min.css +1 -1
  130. package/dist/components/sticky.min.js +1 -1
  131. package/dist/components/tab.css +1 -1
  132. package/dist/components/tab.js +1 -1
  133. package/dist/components/tab.min.css +1 -1
  134. package/dist/components/tab.min.js +1 -1
  135. package/dist/components/table.css +1 -1
  136. package/dist/components/table.min.css +1 -1
  137. package/dist/components/text.css +1 -1
  138. package/dist/components/text.min.css +1 -1
  139. package/dist/components/toast.css +1 -1
  140. package/dist/components/toast.js +1 -1
  141. package/dist/components/toast.min.css +1 -1
  142. package/dist/components/toast.min.js +1 -1
  143. package/dist/components/transition.css +1 -1
  144. package/dist/components/transition.js +1 -1
  145. package/dist/components/transition.min.css +1 -1
  146. package/dist/components/transition.min.js +1 -1
  147. package/dist/components/visibility.js +1 -1
  148. package/dist/components/visibility.min.js +1 -1
  149. package/dist/semantic.css +133 -78
  150. package/dist/semantic.js +268 -62
  151. package/dist/semantic.min.css +2 -2
  152. package/dist/semantic.min.js +2 -2
  153. package/package.json +1 -1
  154. package/src/definitions/modules/flyout.js +216 -30
  155. package/src/definitions/modules/flyout.less +114 -68
  156. package/src/definitions/modules/modal.less +3 -3
  157. package/src/definitions/modules/sidebar.js +26 -6
  158. package/src/definitions/modules/sidebar.less +11 -0
  159. package/src/themes/default/globals/variation.variables +8 -0
  160. package/src/themes/default/modules/flyout.variables +56 -1
  161. package/src/themes/default/modules/modal.variables +2 -2
  162. package/src/themes/default/modules/sidebar.variables +4 -1
package/dist/semantic.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.318+01b81c0
2
+ * # Fomantic UI - 2.9.0-beta.319+0740de8
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -9,7 +9,7 @@
9
9
  *
10
10
  */
11
11
  /*!
12
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Site
12
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - 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.318+01b81c0 - Form Validation
506
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Form Validation
507
507
  * http://github.com/fomantic/Fomantic-UI/
508
508
  *
509
509
  *
@@ -2579,7 +2579,7 @@ $.fn.form.settings = {
2579
2579
  })( jQuery, window, document );
2580
2580
 
2581
2581
  /*!
2582
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Accordion
2582
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Accordion
2583
2583
  * http://github.com/fomantic/Fomantic-UI/
2584
2584
  *
2585
2585
  *
@@ -3204,7 +3204,7 @@ $.extend( $.easing, {
3204
3204
 
3205
3205
 
3206
3206
  /*!
3207
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Calendar
3207
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Calendar
3208
3208
  * http://github.com/fomantic/Fomantic-UI/
3209
3209
  *
3210
3210
  *
@@ -5095,7 +5095,7 @@ $.fn.calendar.settings = {
5095
5095
  })(jQuery, window, document);
5096
5096
 
5097
5097
  /*!
5098
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Checkbox
5098
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Checkbox
5099
5099
  * http://github.com/fomantic/Fomantic-UI/
5100
5100
  *
5101
5101
  *
@@ -5979,7 +5979,7 @@ $.fn.checkbox.settings = {
5979
5979
  })( jQuery, window, document );
5980
5980
 
5981
5981
  /*!
5982
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Dimmer
5982
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Dimmer
5983
5983
  * http://github.com/fomantic/Fomantic-UI/
5984
5984
  *
5985
5985
  *
@@ -6745,7 +6745,7 @@ $.fn.dimmer.settings = {
6745
6745
  })( jQuery, window, document );
6746
6746
 
6747
6747
  /*!
6748
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Dropdown
6748
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Dropdown
6749
6749
  * http://github.com/fomantic/Fomantic-UI/
6750
6750
  *
6751
6751
  *
@@ -11101,7 +11101,7 @@ $.fn.dropdown.settings.templates = {
11101
11101
  })( jQuery, window, document );
11102
11102
 
11103
11103
  /*!
11104
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Embed
11104
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Embed
11105
11105
  * http://github.com/fomantic/Fomantic-UI/
11106
11106
  *
11107
11107
  *
@@ -11815,7 +11815,7 @@ $.fn.embed.settings = {
11815
11815
  })( jQuery, window, document );
11816
11816
 
11817
11817
  /*!
11818
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Flyout
11818
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Flyout
11819
11819
  * http://github.com/fomantic/Fomantic-UI/
11820
11820
  *
11821
11821
  *
@@ -11884,8 +11884,10 @@ $.flyout = $.fn.flyout = function(parameters) {
11884
11884
  moduleNamespace = 'module-' + namespace,
11885
11885
 
11886
11886
  $module = $(this),
11887
- $context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $body,
11888
- $close = $module.find(selector.close),
11887
+ $context = [window,document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $body,
11888
+ $closeIcon = $module.find(selector.close),
11889
+ $inputs,
11890
+ $focusedElement,
11889
11891
 
11890
11892
  $flyouts = $module.children(selector.flyout),
11891
11893
  $pusher = $context.children(selector.pusher),
@@ -11904,6 +11906,7 @@ $.flyout = $.fn.flyout = function(parameters) {
11904
11906
 
11905
11907
  elementNamespace,
11906
11908
  id,
11909
+ observer,
11907
11910
  currentScroll,
11908
11911
  transitionEvent,
11909
11912
 
@@ -11915,6 +11918,7 @@ $.flyout = $.fn.flyout = function(parameters) {
11915
11918
  initialize: function() {
11916
11919
  module.debug('Initializing flyout', parameters);
11917
11920
 
11921
+ module.create.id();
11918
11922
  if(!isFlyoutComponent) {
11919
11923
  module.create.flyout();
11920
11924
  if(!$.isFunction(settings.onHidden)) {
@@ -11943,13 +11947,14 @@ $.flyout = $.fn.flyout = function(parameters) {
11943
11947
  }
11944
11948
  settings.actions.forEach(function (el) {
11945
11949
  var
11946
- icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
11950
+ icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
11947
11951
  text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
11948
11952
  cls = module.helpers.deQuote(el[fields.class] || ''),
11949
11953
  click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {}
11950
11954
  ;
11951
11955
  $actions.append($('<button/>', {
11952
11956
  html: icon + text,
11957
+ 'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g,''),
11953
11958
  class: className.button + ' ' + cls,
11954
11959
  click: function () {
11955
11960
  if (click.call(element, $module) === false) {
@@ -11961,8 +11966,6 @@ $.flyout = $.fn.flyout = function(parameters) {
11961
11966
  });
11962
11967
  }
11963
11968
 
11964
- module.create.id();
11965
-
11966
11969
  transitionEvent = module.get.transitionEvent();
11967
11970
 
11968
11971
  // avoids locking rendering if initialized in onReady
@@ -11981,6 +11984,9 @@ $.flyout = $.fn.flyout = function(parameters) {
11981
11984
  module.setup.heights();
11982
11985
  module.bind.resize();
11983
11986
  }
11987
+ module.refreshInputs();
11988
+ module.bind.events();
11989
+ module.observeChanges();
11984
11990
  module.instantiate();
11985
11991
 
11986
11992
  if(settings.autoShow){
@@ -11999,30 +12005,37 @@ $.flyout = $.fn.flyout = function(parameters) {
11999
12005
  create: {
12000
12006
  flyout: function() {
12001
12007
  module.verbose('Programmaticaly create flyout', $context);
12002
- $module = $('<div/>', {class: className.flyout});
12008
+ $module = $('<div/>', {class: className.flyout, role: 'dialog', 'aria-modal': settings.dimPage});
12003
12009
  if (settings.closeIcon) {
12004
- $close = $('<i/>', {class: className.close})
12005
- $module.append($close);
12010
+ $closeIcon = $('<i/>', {class: className.close, role: 'button', tabindex: 0, 'aria-label': settings.text.close})
12011
+ $module.append($closeIcon);
12006
12012
  }
12007
12013
  if (settings.title !== '') {
12008
- $('<div/>', {class: className.header}).appendTo($module);
12014
+ var titleId = '_' + module.get.id() + 'title';
12015
+ $module.attr('aria-labelledby', titleId);
12016
+ $('<div/>', {class: className.header, id: titleId}).appendTo($module);
12009
12017
  }
12010
12018
  if (settings.content !== '') {
12011
- $('<div/>', {class: className.content}).appendTo($module);
12019
+ var descId = '_' + module.get.id() + 'desc';
12020
+ $module.attr('aria-describedby', descId);
12021
+ $('<div/>', {class: className.content, id: descId}).appendTo($module);
12012
12022
  }
12013
12023
  if (module.has.configActions()) {
12014
12024
  $('<div/>', {class: className.actions}).appendTo($module);
12015
12025
  }
12016
- $context.append($module);
12026
+ $module.prependTo($context);
12017
12027
  },
12018
12028
  id: function() {
12019
- id = (Math.random().toString(16) + '000000000').substr(2,8);
12029
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
12020
12030
  elementNamespace = '.' + id;
12021
12031
  module.verbose('Creating unique id for element', id);
12022
12032
  }
12023
12033
  },
12024
12034
 
12025
12035
  destroy: function() {
12036
+ if (observer) {
12037
+ observer.disconnect();
12038
+ }
12026
12039
  module.verbose('Destroying previous module for', $module);
12027
12040
  $module
12028
12041
  .off(eventNamespace)
@@ -12031,6 +12044,10 @@ $.flyout = $.fn.flyout = function(parameters) {
12031
12044
  if(module.is.ios()) {
12032
12045
  module.remove.ios();
12033
12046
  }
12047
+ $closeIcon.off(elementNamespace);
12048
+ if($inputs) {
12049
+ $inputs.off(elementNamespace);
12050
+ }
12034
12051
  // bound by uuid
12035
12052
  $context.off(elementNamespace);
12036
12053
  $window.off(elementNamespace);
@@ -12038,6 +12055,21 @@ $.flyout = $.fn.flyout = function(parameters) {
12038
12055
  },
12039
12056
 
12040
12057
  event: {
12058
+ keyboard: function(event) {
12059
+ var
12060
+ keyCode = event.which
12061
+ ;
12062
+ if(keyCode === settings.keys.escape) {
12063
+ if(settings.closable) {
12064
+ module.debug('Escape key pressed hiding flyout');
12065
+ module.hide();
12066
+ }
12067
+ else {
12068
+ module.debug('Escape key pressed, but closable is set to false');
12069
+ }
12070
+ event.preventDefault();
12071
+ }
12072
+ },
12041
12073
  resize: function() {
12042
12074
  module.setup.heights();
12043
12075
  },
@@ -12060,6 +12092,34 @@ $.flyout = $.fn.flyout = function(parameters) {
12060
12092
  close: function(event) {
12061
12093
  module.hide();
12062
12094
  },
12095
+ closeKeyUp: function(event){
12096
+ var
12097
+ keyCode = event.which
12098
+ ;
12099
+ if (keyCode === settings.keys.enter || keyCode === settings.keys.space) {
12100
+ module.hide();
12101
+ }
12102
+ },
12103
+ inputKeyDown: {
12104
+ first: function(event) {
12105
+ var
12106
+ keyCode = event.which
12107
+ ;
12108
+ if (keyCode === settings.keys.tab && event.shiftKey) {
12109
+ $inputs.last().focus();
12110
+ event.preventDefault();
12111
+ }
12112
+ },
12113
+ last: function(event) {
12114
+ var
12115
+ keyCode = event.which
12116
+ ;
12117
+ if (keyCode === settings.keys.tab && !event.shiftKey) {
12118
+ $inputs.first().focus();
12119
+ event.preventDefault();
12120
+ }
12121
+ }
12122
+ },
12063
12123
  approve: function(event) {
12064
12124
  if (ignoreRepeatedEvents || settings.onApprove.call(module.element, $(this)) === false) {
12065
12125
  module.verbose('Approve callback returned false cancelling close');
@@ -12103,16 +12163,23 @@ $.flyout = $.fn.flyout = function(parameters) {
12103
12163
  module.verbose('Adding resize event to window', $window);
12104
12164
  $window.on('resize' + elementNamespace, module.event.resize);
12105
12165
  },
12166
+ events: function() {
12167
+ module.verbose('Attaching events');
12168
+ $module
12169
+ .on('click' + eventNamespace, selector.close, module.event.close)
12170
+ .on('click' + eventNamespace, selector.approve, module.event.approve)
12171
+ .on('click' + eventNamespace, selector.deny, module.event.deny)
12172
+ ;
12173
+ $closeIcon
12174
+ .on('keyup' + elementNamespace, module.event.closeKeyUp)
12175
+ ;
12176
+ },
12106
12177
  clickaway: function() {
12107
12178
  module.verbose('Adding clickaway events to context', $context);
12108
12179
  $context
12109
12180
  .on('click' + elementNamespace, module.event.clickaway)
12110
12181
  .on('touchend' + elementNamespace, module.event.clickaway)
12111
12182
  ;
12112
-
12113
- $module.on('click' + elementNamespace, settings.selector.close, module.event.close);
12114
- $module.on('click' + elementNamespace, settings.selector.approve, module.event.approve);
12115
- $module.on('click' + elementNamespace, settings.selector.deny, module.event.deny);
12116
12183
  },
12117
12184
  scrollLock: function() {
12118
12185
  if(settings.scrollLock) {
@@ -12199,7 +12266,7 @@ $.flyout = $.fn.flyout = function(parameters) {
12199
12266
  if(direction === 'left' || direction === 'right') {
12200
12267
  module.debug('Adding CSS rules for animation distance', width);
12201
12268
  style += ''
12202
- + ' body.pushable > .ui.visible.' + direction + '.flyout ~ .pusher:after {'
12269
+ + ' body.pushable > .ui.visible.' + direction + '.flyout ~ .pusher::after {'
12203
12270
  + ' -webkit-transform: translate3d('+ distance[direction] + 'px, 0, 0);'
12204
12271
  + ' transform: translate3d('+ distance[direction] + 'px, 0, 0);'
12205
12272
  + ' }'
@@ -12207,7 +12274,7 @@ $.flyout = $.fn.flyout = function(parameters) {
12207
12274
  }
12208
12275
  else if(direction === 'top' || direction == 'bottom') {
12209
12276
  style += ''
12210
- + ' body.pushable > .ui.visible.' + direction + '.flyout ~ .pusher:after {'
12277
+ + ' body.pushable > .ui.visible.' + direction + '.flyout ~ .pusher::after {'
12211
12278
  + ' -webkit-transform: translate3d(0, ' + distance[direction] + 'px, 0);'
12212
12279
  + ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
12213
12280
  + ' }'
@@ -12215,8 +12282,8 @@ $.flyout = $.fn.flyout = function(parameters) {
12215
12282
  }
12216
12283
  /* opposite sides visible forces content overlay */
12217
12284
  style += ''
12218
- + ' body.pushable > .ui.visible.left.flyout ~ .ui.visible.right.flyout ~ .pusher:after,'
12219
- + ' body.pushable > .ui.visible.right.flyout ~ .ui.visible.left.flyout ~ .pusher:after {'
12285
+ + ' body.pushable > .ui.visible.left.flyout ~ .ui.visible.right.flyout ~ .pusher::after,'
12286
+ + ' body.pushable > .ui.visible.right.flyout ~ .ui.visible.left.flyout ~ .pusher::after {'
12220
12287
  + ' -webkit-transform: translate3d(0, 0, 0);'
12221
12288
  + ' transform: translate3d(0, 0, 0);'
12222
12289
  + ' }'
@@ -12227,13 +12294,30 @@ $.flyout = $.fn.flyout = function(parameters) {
12227
12294
  .appendTo($head)
12228
12295
  ;
12229
12296
  module.debug('Adding sizing css to head', $style);
12297
+ },
12298
+ keyboardShortcuts: function() {
12299
+ module.verbose('Adding keyboard shortcuts');
12300
+ $document
12301
+ .on('keydown' + eventNamespace, module.event.keyboard)
12302
+ ;
12303
+ }
12304
+ },
12305
+ observeChanges: function() {
12306
+ if('MutationObserver' in window) {
12307
+ observer = new MutationObserver(function(mutations) {
12308
+ module.refreshInputs();
12309
+ });
12310
+ observer.observe(element, {
12311
+ childList : true,
12312
+ subtree : true
12313
+ });
12314
+ module.debug('Setting up mutation observer', observer);
12230
12315
  }
12231
12316
  },
12232
-
12233
12317
  refresh: function() {
12234
12318
  module.verbose('Refreshing selector cache');
12235
- $context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context);
12236
- $flyouts = $context.children(selector.flyout);
12319
+ $context = [window,document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $body;
12320
+ module.refreshFlyouts();
12237
12321
  $pusher = $context.children(selector.pusher);
12238
12322
  module.clear.cache();
12239
12323
  },
@@ -12243,6 +12327,26 @@ $.flyout = $.fn.flyout = function(parameters) {
12243
12327
  $flyouts = $context.children(selector.flyout);
12244
12328
  },
12245
12329
 
12330
+ refreshInputs: function(){
12331
+ if($inputs){
12332
+ $inputs
12333
+ .off('keydown' + elementNamespace)
12334
+ ;
12335
+ }
12336
+ if(!settings.dimPage){
12337
+ return;
12338
+ }
12339
+ $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
12340
+ return $(this).closest('.disabled').length === 0;
12341
+ });
12342
+ $inputs.first()
12343
+ .on('keydown' + elementNamespace, module.event.inputKeyDown.first)
12344
+ ;
12345
+ $inputs.last()
12346
+ .on('keydown' + elementNamespace, module.event.inputKeyDown.last)
12347
+ ;
12348
+ },
12349
+
12246
12350
  setup: {
12247
12351
  cache: function() {
12248
12352
  module.cache = {
@@ -12312,7 +12416,10 @@ $.flyout = $.fn.flyout = function(parameters) {
12312
12416
  : function(){}
12313
12417
  ;
12314
12418
  if(module.is.hidden()) {
12315
- module.refreshFlyouts();
12419
+ if(settings.onShow.call(element) === false) {
12420
+ module.verbose('Show callback returned false cancelling show');
12421
+ return;
12422
+ }
12316
12423
  module.refresh();
12317
12424
  if(module.othersActive()) {
12318
12425
  module.debug('Other flyouts currently visible');
@@ -12322,12 +12429,19 @@ $.flyout = $.fn.flyout = function(parameters) {
12322
12429
  ignoreRepeatedEvents = false;
12323
12430
  }
12324
12431
  }
12432
+ module.set.dimmerStyles();
12325
12433
  module.pushPage(function() {
12326
12434
  callback.call(element);
12327
- settings.onShow.call(element);
12435
+ settings.onVisible.call(element);
12436
+ if(settings.keyboardShortcuts) {
12437
+ module.add.keyboardShortcuts();
12438
+ }
12439
+ module.save.focus();
12440
+ if(settings.autofocus) {
12441
+ module.set.autofocus();
12442
+ }
12328
12443
  });
12329
12444
  settings.onChange.call(element);
12330
- settings.onVisible.call(element);
12331
12445
  }
12332
12446
  else {
12333
12447
  module.debug('Flyout is already visible');
@@ -12352,6 +12466,7 @@ $.flyout = $.fn.flyout = function(parameters) {
12352
12466
  if($.isFunction(settings.onHidden)) {
12353
12467
  settings.onHidden.call(element);
12354
12468
  }
12469
+ module.restore.focus();
12355
12470
  });
12356
12471
  settings.onChange.call(element);
12357
12472
  }
@@ -12447,18 +12562,25 @@ $.flyout = $.fn.flyout = function(parameters) {
12447
12562
  module.unbind.clickaway();
12448
12563
  if(!module.othersActive()) {
12449
12564
  module.unbind.scrollLock();
12565
+ if( settings.keyboardShortcuts ) {
12566
+ module.remove.keyboardShortcuts();
12567
+ }
12450
12568
  }
12451
12569
 
12570
+
12452
12571
  animate = function() {
12453
12572
  module.set.overlay();
12454
12573
  module.set.animating();
12574
+ if(settings.dimPage && !module.othersVisible()) {
12575
+ module.set.closing();
12576
+ }
12455
12577
  module.remove.visible();
12456
-
12457
12578
  };
12458
12579
  transitionEnd = function(event) {
12459
12580
  if( event.target == $module[0] ) {
12460
12581
  $module.off(transitionEvent + elementNamespace, transitionEnd);
12461
12582
  module.remove.animating();
12583
+ module.remove.closing();
12462
12584
  module.remove.overlay();
12463
12585
  module.remove.inlineCSS();
12464
12586
  if(settings.returnScroll) {
@@ -12494,6 +12616,25 @@ $.flyout = $.fn.flyout = function(parameters) {
12494
12616
  },
12495
12617
 
12496
12618
  set: {
12619
+ autofocus: function() {
12620
+ var
12621
+ $autofocus = $inputs.filter('[autofocus]'),
12622
+ $input = ($autofocus.length > 0)
12623
+ ? $autofocus.first()
12624
+ : ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
12625
+ ;
12626
+ if($input.length > 0) {
12627
+ $input.focus();
12628
+ }
12629
+ },
12630
+ dimmerStyles: function() {
12631
+ if(settings.blurring) {
12632
+ $pusher.addClass(className.blurring);
12633
+ }
12634
+ else {
12635
+ $pusher.removeClass(className.blurring);
12636
+ }
12637
+ },
12497
12638
  bodyMargin: function() {
12498
12639
  var position = module.can.leftBodyScrollbar() ? 'left':'right';
12499
12640
  $context.css((isBody ? 'margin-':'padding-')+position, tempBodyMargin + 'px');
@@ -12531,6 +12672,9 @@ $.flyout = $.fn.flyout = function(parameters) {
12531
12672
  animating: function() {
12532
12673
  $module.addClass(className.animating);
12533
12674
  },
12675
+ closing: function() {
12676
+ $pusher.addClass(className.closing);
12677
+ },
12534
12678
  direction: function(direction) {
12535
12679
  direction = direction || module.get.direction();
12536
12680
  $module.addClass(className[direction]);
@@ -12550,6 +12694,12 @@ $.flyout = $.fn.flyout = function(parameters) {
12550
12694
  $style.remove();
12551
12695
  }
12552
12696
  },
12697
+ keyboardShortcuts: function() {
12698
+ module.verbose('Removing keyboard shortcuts');
12699
+ $document
12700
+ .off('keydown' + eventNamespace)
12701
+ ;
12702
+ },
12553
12703
 
12554
12704
  // ios scroll on html not document
12555
12705
  ios: function() {
@@ -12571,6 +12721,9 @@ $.flyout = $.fn.flyout = function(parameters) {
12571
12721
  animating: function() {
12572
12722
  $module.removeClass(className.animating);
12573
12723
  },
12724
+ closing: function() {
12725
+ $pusher.removeClass(className.closing);
12726
+ },
12574
12727
  direction: function(direction) {
12575
12728
  direction = direction || module.get.direction();
12576
12729
  $module.removeClass(className[direction]);
@@ -12584,7 +12737,6 @@ $.flyout = $.fn.flyout = function(parameters) {
12584
12737
  },
12585
12738
 
12586
12739
  get: {
12587
-
12588
12740
  direction: function() {
12589
12741
  if($module.hasClass(className.top)) {
12590
12742
  return className.top;
@@ -12614,6 +12766,12 @@ $.flyout = $.fn.flyout = function(parameters) {
12614
12766
  }
12615
12767
  }
12616
12768
  },
12769
+ id: function() {
12770
+ return id;
12771
+ },
12772
+ element: function() {
12773
+ return $module;
12774
+ },
12617
12775
  settings: function() {
12618
12776
  return settings;
12619
12777
  }
@@ -12629,6 +12787,15 @@ $.flyout = $.fn.flyout = function(parameters) {
12629
12787
  },
12630
12788
 
12631
12789
  save: {
12790
+ focus: function() {
12791
+ var
12792
+ $activeElement = $(document.activeElement),
12793
+ inCurrentFlyout = $activeElement.closest($module).length > 0
12794
+ ;
12795
+ if(!inCurrentFlyout) {
12796
+ $focusedElement = $(document.activeElement).blur();
12797
+ }
12798
+ },
12632
12799
  bodyMargin: function() {
12633
12800
  initialBodyMargin = $context.css((isBody ? 'margin-':'padding-')+(module.can.leftBodyScrollbar() ? 'left':'right'));
12634
12801
  var bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, '')),
@@ -12724,6 +12891,11 @@ $.flyout = $.fn.flyout = function(parameters) {
12724
12891
  },
12725
12892
 
12726
12893
  restore: {
12894
+ focus: function() {
12895
+ if($focusedElement && $focusedElement.length > 0 && settings.restoreFocus) {
12896
+ $focusedElement.focus();
12897
+ }
12898
+ },
12727
12899
  bodyMargin: function() {
12728
12900
  var position = module.can.leftBodyScrollbar() ? 'left':'right';
12729
12901
  $context.css((isBody ? 'margin-':'padding-')+position, initialBodyMargin);
@@ -12759,7 +12931,7 @@ $.flyout = $.fn.flyout = function(parameters) {
12759
12931
  }
12760
12932
  ;
12761
12933
  if(shouldEscape.test(string)) {
12762
- string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&amp;");
12934
+ string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, "&amp;");
12763
12935
  return string.replace(badChars, escapedChar);
12764
12936
  }
12765
12937
  return string;
@@ -12977,12 +13149,16 @@ $.fn.flyout.settings = {
12977
13149
  context : 'body',
12978
13150
  exclusive : false,
12979
13151
  closable : true,
13152
+ autofocus : true,
13153
+ restoreFocus : true,
12980
13154
  dimPage : true,
12981
13155
  scrollLock : false,
12982
13156
  returnScroll : false,
12983
13157
  delaySetup : false,
12984
13158
  autoShow : false,
12985
13159
 
13160
+ keyboardShortcuts: true,
13161
+
12986
13162
  //dynamic content
12987
13163
  title : '',
12988
13164
  content : '',
@@ -13011,6 +13187,13 @@ $.fn.flyout.settings = {
13011
13187
  onApprove : function(){},
13012
13188
  onDeny : function(){},
13013
13189
 
13190
+ keys : {
13191
+ space : 32,
13192
+ enter : 13,
13193
+ escape : 27,
13194
+ tab : 9,
13195
+ },
13196
+
13014
13197
  className : {
13015
13198
  flyout : 'ui flyout',
13016
13199
  close : 'close icon',
@@ -13019,6 +13202,8 @@ $.fn.flyout.settings = {
13019
13202
  actions : 'actions',
13020
13203
  active : 'active',
13021
13204
  animating : 'animating',
13205
+ blurring : 'blurring',
13206
+ closing : 'closing',
13022
13207
  dimmed : 'dimmed',
13023
13208
  ios : 'ios',
13024
13209
  locked : 'locked',
@@ -13067,7 +13252,8 @@ $.fn.flyout.settings = {
13067
13252
 
13068
13253
  text: {
13069
13254
  ok : 'Ok',
13070
- cancel : 'Cancel'
13255
+ cancel : 'Cancel',
13256
+ close : 'Close'
13071
13257
  }
13072
13258
  };
13073
13259
 
@@ -13159,7 +13345,7 @@ $.fn.flyout.settings.templates = {
13159
13345
  })( jQuery, window, document );
13160
13346
 
13161
13347
  /*!
13162
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Modal
13348
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Modal
13163
13349
  * http://github.com/fomantic/Fomantic-UI/
13164
13350
  *
13165
13351
  *
@@ -14715,7 +14901,7 @@ $.fn.modal.settings.templates = {
14715
14901
  })( jQuery, window, document );
14716
14902
 
14717
14903
  /*!
14718
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Nag
14904
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Nag
14719
14905
  * http://github.com/fomantic/Fomantic-UI/
14720
14906
  *
14721
14907
  *
@@ -15274,7 +15460,7 @@ $.extend( $.easing, {
15274
15460
  })( jQuery, window, document );
15275
15461
 
15276
15462
  /*!
15277
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Popup
15463
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Popup
15278
15464
  * http://github.com/fomantic/Fomantic-UI/
15279
15465
  *
15280
15466
  *
@@ -16810,7 +16996,7 @@ $.fn.popup.settings = {
16810
16996
  })( jQuery, window, document );
16811
16997
 
16812
16998
  /*!
16813
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Progress
16999
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Progress
16814
17000
  * http://github.com/fomantic/Fomantic-UI/
16815
17001
  *
16816
17002
  *
@@ -17847,7 +18033,7 @@ $.fn.progress.settings = {
17847
18033
  })( jQuery, window, document );
17848
18034
 
17849
18035
  /*!
17850
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Slider
18036
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Slider
17851
18037
  * http://github.com/fomantic/Fomantic-UI/
17852
18038
  *
17853
18039
  *
@@ -19201,7 +19387,7 @@ $.fn.slider.settings = {
19201
19387
  })( jQuery, window, document );
19202
19388
 
19203
19389
  /*!
19204
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Rating
19390
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Rating
19205
19391
  * http://github.com/fomantic/Fomantic-UI/
19206
19392
  *
19207
19393
  *
@@ -19760,7 +19946,7 @@ $.fn.rating.settings = {
19760
19946
  })( jQuery, window, document );
19761
19947
 
19762
19948
  /*!
19763
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Search
19949
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Search
19764
19950
  * http://github.com/fomantic/Fomantic-UI/
19765
19951
  *
19766
19952
  *
@@ -21355,7 +21541,7 @@ $.extend($.easing, {
21355
21541
  })( jQuery, window, document );
21356
21542
 
21357
21543
  /*!
21358
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Shape
21544
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Shape
21359
21545
  * http://github.com/fomantic/Fomantic-UI/
21360
21546
  *
21361
21547
  *
@@ -22204,7 +22390,7 @@ $.fn.shape.settings = {
22204
22390
  })( jQuery, window, document );
22205
22391
 
22206
22392
  /*!
22207
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Sidebar
22393
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Sidebar
22208
22394
  * http://github.com/fomantic/Fomantic-UI/
22209
22395
  *
22210
22396
  *
@@ -22272,7 +22458,7 @@ $.fn.sidebar = function(parameters) {
22272
22458
  moduleNamespace = 'module-' + namespace,
22273
22459
 
22274
22460
  $module = $(this),
22275
- $context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $body,
22461
+ $context = [window,document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $body,
22276
22462
  isBody = $context[0] === $body[0],
22277
22463
 
22278
22464
  $sidebars = $module.children(selector.sidebar),
@@ -22510,8 +22696,8 @@ $.fn.sidebar = function(parameters) {
22510
22696
 
22511
22697
  refresh: function() {
22512
22698
  module.verbose('Refreshing selector cache');
22513
- $context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context);
22514
- $sidebars = $context.children(selector.sidebar);
22699
+ $context = [window,document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $body;
22700
+ module.refreshSidebars();
22515
22701
  $pusher = $context.children(selector.pusher);
22516
22702
  $fixed = $context.children(selector.fixed);
22517
22703
  module.clear.cache();
@@ -22606,7 +22792,6 @@ $.fn.sidebar = function(parameters) {
22606
22792
  module.verbose('Show callback returned false cancelling show');
22607
22793
  return;
22608
22794
  }
22609
- module.refreshSidebars();
22610
22795
  if(settings.overlay) {
22611
22796
  module.error(error.overlay);
22612
22797
  settings.transition = 'overlay';
@@ -22628,6 +22813,7 @@ $.fn.sidebar = function(parameters) {
22628
22813
  settings.transition = 'overlay';
22629
22814
  }
22630
22815
  }
22816
+ module.set.dimmerStyles();
22631
22817
  module.pushPage(function() {
22632
22818
  callback.call(element);
22633
22819
  settings.onVisible.call(element);
@@ -22760,20 +22946,24 @@ $.fn.sidebar = function(parameters) {
22760
22946
  animate = function() {
22761
22947
  module.set.transition(transition);
22762
22948
  module.set.animating();
22763
- module.remove.visible();
22764
22949
  if(settings.dimPage && !module.othersVisible()) {
22765
- $pusher.removeClass(className.dimmed);
22950
+ module.set.closing();
22766
22951
  }
22952
+ module.remove.visible();
22767
22953
  };
22768
22954
  transitionEnd = function(event) {
22769
22955
  if( event.target == $transition[0] ) {
22770
22956
  $transition.off(transitionEvent + elementNamespace, transitionEnd);
22771
22957
  module.remove.animating();
22958
+ module.remove.closing();
22772
22959
  module.remove.transition();
22773
22960
  module.remove.inlineCSS();
22774
22961
  if(transition === 'scale down' || settings.returnScroll) {
22775
22962
  module.scrollBack();
22776
22963
  }
22964
+ if(settings.dimPage && !module.othersVisible()) {
22965
+ $pusher.removeClass(className.dimmed);
22966
+ }
22777
22967
  callback.call(element);
22778
22968
  }
22779
22969
  };
@@ -22811,6 +23001,14 @@ $.fn.sidebar = function(parameters) {
22811
23001
  el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
22812
23002
  });
22813
23003
  },
23004
+ dimmerStyles: function() {
23005
+ if(settings.blurring) {
23006
+ $pusher.addClass(className.blurring);
23007
+ }
23008
+ else {
23009
+ $pusher.removeClass(className.blurring);
23010
+ }
23011
+ },
22814
23012
  // ios only (scroll on html not document). This prevent auto-resize canvas/scroll in ios
22815
23013
  // (This is no longer necessary in latest iOS)
22816
23014
  ios: function() {
@@ -22837,6 +23035,9 @@ $.fn.sidebar = function(parameters) {
22837
23035
  animating: function() {
22838
23036
  $module.addClass(className.animating);
22839
23037
  },
23038
+ closing: function() {
23039
+ $pusher.addClass(className.closing);
23040
+ },
22840
23041
  transition: function(transition) {
22841
23042
  transition = transition || module.get.transition();
22842
23043
  $module.addClass(transition);
@@ -22881,6 +23082,9 @@ $.fn.sidebar = function(parameters) {
22881
23082
  animating: function() {
22882
23083
  $module.removeClass(className.animating);
22883
23084
  },
23085
+ closing: function() {
23086
+ $pusher.removeClass(className.closing);
23087
+ },
22884
23088
  transition: function(transition) {
22885
23089
  transition = transition || module.get.transition();
22886
23090
  $module.removeClass(transition);
@@ -23278,6 +23482,8 @@ $.fn.sidebar.settings = {
23278
23482
  className : {
23279
23483
  active : 'active',
23280
23484
  animating : 'animating',
23485
+ blurring : 'blurring',
23486
+ closing : 'closing',
23281
23487
  dimmed : 'dimmed',
23282
23488
  ios : 'ios',
23283
23489
  locked : 'locked',
@@ -23318,7 +23524,7 @@ $.fn.sidebar.settings = {
23318
23524
  })( jQuery, window, document );
23319
23525
 
23320
23526
  /*!
23321
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Sticky
23527
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Sticky
23322
23528
  * http://github.com/fomantic/Fomantic-UI/
23323
23529
  *
23324
23530
  *
@@ -24269,7 +24475,7 @@ $.fn.sticky.settings = {
24269
24475
  })( jQuery, window, document );
24270
24476
 
24271
24477
  /*!
24272
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Tab
24478
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Tab
24273
24479
  * http://github.com/fomantic/Fomantic-UI/
24274
24480
  *
24275
24481
  *
@@ -25289,7 +25495,7 @@ $.fn.tab.settings = {
25289
25495
  })( jQuery, window, document );
25290
25496
 
25291
25497
  /*!
25292
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Toast
25498
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Toast
25293
25499
  * http://github.com/fomantic/Fomantic-UI/
25294
25500
  *
25295
25501
  *
@@ -26216,7 +26422,7 @@ $.extend( $.easing, {
26216
26422
  })( jQuery, window, document );
26217
26423
 
26218
26424
  /*!
26219
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Transition
26425
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Transition
26220
26426
  * http://github.com/fomantic/Fomantic-UI/
26221
26427
  *
26222
26428
  *
@@ -27331,7 +27537,7 @@ $.fn.transition.settings = {
27331
27537
  })( jQuery, window, document );
27332
27538
 
27333
27539
  /*!
27334
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - API
27540
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - API
27335
27541
  * http://github.com/fomantic/Fomantic-UI/
27336
27542
  *
27337
27543
  *
@@ -28568,7 +28774,7 @@ $.api.settings = {
28568
28774
  })( jQuery, window, document );
28569
28775
 
28570
28776
  /*!
28571
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - State
28777
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - State
28572
28778
  * http://github.com/fomantic/Fomantic-UI/
28573
28779
  *
28574
28780
  *
@@ -29280,7 +29486,7 @@ $.fn.state.settings = {
29280
29486
  })( jQuery, window, document );
29281
29487
 
29282
29488
  /*!
29283
- * # Fomantic-UI 2.9.0-beta.318+01b81c0 - Visibility
29489
+ * # Fomantic-UI 2.9.0-beta.319+0740de8 - Visibility
29284
29490
  * http://github.com/fomantic/Fomantic-UI/
29285
29491
  *
29286
29492
  *