fomantic-ui 2.10.0-beta.7 → 2.10.0-beta.9

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 (229) hide show
  1. package/.eslintrc.js +0 -10
  2. package/README.md +4 -5
  3. package/changelog-setup.js +64 -70
  4. package/dist/components/accordion.css +1 -1
  5. package/dist/components/accordion.js +94 -131
  6. package/dist/components/accordion.min.css +1 -1
  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 +152 -205
  11. package/dist/components/api.min.js +2 -2
  12. package/dist/components/breadcrumb.css +1 -1
  13. package/dist/components/breadcrumb.min.css +1 -1
  14. package/dist/components/button.css +1 -1
  15. package/dist/components/button.min.css +1 -1
  16. package/dist/components/calendar.css +1 -1
  17. package/dist/components/calendar.js +305 -341
  18. package/dist/components/calendar.min.css +1 -1
  19. package/dist/components/calendar.min.js +2 -2
  20. package/dist/components/card.css +1 -1
  21. package/dist/components/card.min.css +1 -1
  22. package/dist/components/checkbox.css +1 -1
  23. package/dist/components/checkbox.js +76 -116
  24. package/dist/components/checkbox.min.css +1 -1
  25. package/dist/components/checkbox.min.js +2 -2
  26. package/dist/components/comment.css +1 -1
  27. package/dist/components/comment.min.css +1 -1
  28. package/dist/components/container.css +1 -1
  29. package/dist/components/container.min.css +1 -1
  30. package/dist/components/dimmer.css +1 -1
  31. package/dist/components/dimmer.js +58 -91
  32. package/dist/components/dimmer.min.css +1 -1
  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 +7 -5
  37. package/dist/components/dropdown.js +653 -943
  38. package/dist/components/dropdown.min.css +2 -2
  39. package/dist/components/dropdown.min.js +2 -2
  40. package/dist/components/embed.css +1 -1
  41. package/dist/components/embed.js +71 -109
  42. package/dist/components/embed.min.css +1 -1
  43. package/dist/components/embed.min.js +2 -2
  44. package/dist/components/emoji.css +1 -1
  45. package/dist/components/emoji.min.css +1 -1
  46. package/dist/components/feed.css +1 -1
  47. package/dist/components/feed.min.css +1 -1
  48. package/dist/components/flag.css +1 -1
  49. package/dist/components/flag.min.css +1 -1
  50. package/dist/components/flyout.css +1 -1
  51. package/dist/components/flyout.js +183 -257
  52. package/dist/components/flyout.min.css +1 -1
  53. package/dist/components/flyout.min.js +2 -2
  54. package/dist/components/form.css +1 -1
  55. package/dist/components/form.js +325 -429
  56. package/dist/components/form.min.css +1 -1
  57. package/dist/components/form.min.js +2 -2
  58. package/dist/components/grid.css +1 -1
  59. package/dist/components/grid.min.css +1 -1
  60. package/dist/components/header.css +1 -1
  61. package/dist/components/header.min.css +1 -1
  62. package/dist/components/icon.css +1 -1
  63. package/dist/components/icon.min.css +1 -1
  64. package/dist/components/image.css +1 -1
  65. package/dist/components/image.min.css +1 -1
  66. package/dist/components/input.css +1 -1
  67. package/dist/components/input.min.css +1 -1
  68. package/dist/components/item.css +1 -1
  69. package/dist/components/item.min.css +1 -1
  70. package/dist/components/label.css +1 -1
  71. package/dist/components/label.min.css +1 -1
  72. package/dist/components/list.css +1 -1
  73. package/dist/components/list.min.css +1 -1
  74. package/dist/components/loader.css +1 -1
  75. package/dist/components/loader.min.css +1 -1
  76. package/dist/components/menu.css +1 -1
  77. package/dist/components/menu.min.css +1 -1
  78. package/dist/components/message.css +1 -1
  79. package/dist/components/message.min.css +1 -1
  80. package/dist/components/modal.css +1 -1
  81. package/dist/components/modal.js +212 -296
  82. package/dist/components/modal.min.css +1 -1
  83. package/dist/components/modal.min.js +2 -2
  84. package/dist/components/nag.css +1 -1
  85. package/dist/components/nag.js +67 -97
  86. package/dist/components/nag.min.css +1 -1
  87. package/dist/components/nag.min.js +2 -2
  88. package/dist/components/placeholder.css +1 -1
  89. package/dist/components/placeholder.min.css +1 -1
  90. package/dist/components/popup.css +1 -1
  91. package/dist/components/popup.js +176 -236
  92. package/dist/components/popup.min.css +1 -1
  93. package/dist/components/popup.min.js +2 -2
  94. package/dist/components/progress.css +1 -1
  95. package/dist/components/progress.js +103 -138
  96. package/dist/components/progress.min.css +1 -1
  97. package/dist/components/progress.min.js +2 -2
  98. package/dist/components/rail.css +1 -1
  99. package/dist/components/rail.min.css +1 -1
  100. package/dist/components/rating.css +1 -1
  101. package/dist/components/rating.js +80 -121
  102. package/dist/components/rating.min.css +1 -1
  103. package/dist/components/rating.min.js +2 -2
  104. package/dist/components/reset.css +1 -1
  105. package/dist/components/reset.min.css +1 -1
  106. package/dist/components/reveal.css +1 -1
  107. package/dist/components/reveal.min.css +1 -1
  108. package/dist/components/search.css +1 -1
  109. package/dist/components/search.js +240 -334
  110. package/dist/components/search.min.css +1 -1
  111. package/dist/components/search.min.js +2 -2
  112. package/dist/components/segment.css +1 -1
  113. package/dist/components/segment.min.css +1 -1
  114. package/dist/components/shape.css +1 -1
  115. package/dist/components/shape.js +157 -223
  116. package/dist/components/shape.min.css +1 -1
  117. package/dist/components/shape.min.js +2 -2
  118. package/dist/components/sidebar.css +1 -1
  119. package/dist/components/sidebar.js +122 -163
  120. package/dist/components/sidebar.min.css +1 -1
  121. package/dist/components/sidebar.min.js +2 -2
  122. package/dist/components/site.css +1 -1
  123. package/dist/components/site.js +38 -57
  124. package/dist/components/site.min.css +1 -1
  125. package/dist/components/site.min.js +2 -2
  126. package/dist/components/slider.css +1 -1
  127. package/dist/components/slider.js +242 -325
  128. package/dist/components/slider.min.css +1 -1
  129. package/dist/components/slider.min.js +2 -2
  130. package/dist/components/state.js +68 -98
  131. package/dist/components/state.min.js +2 -2
  132. package/dist/components/statistic.css +1 -1
  133. package/dist/components/statistic.min.css +1 -1
  134. package/dist/components/step.css +1 -1
  135. package/dist/components/step.min.css +1 -1
  136. package/dist/components/sticky.css +1 -1
  137. package/dist/components/sticky.js +116 -159
  138. package/dist/components/sticky.min.css +1 -1
  139. package/dist/components/sticky.min.js +2 -2
  140. package/dist/components/tab.css +1 -1
  141. package/dist/components/tab.js +168 -233
  142. package/dist/components/tab.min.css +1 -1
  143. package/dist/components/tab.min.js +2 -2
  144. package/dist/components/table.css +1 -1
  145. package/dist/components/table.min.css +1 -1
  146. package/dist/components/text.css +1 -1
  147. package/dist/components/text.min.css +1 -1
  148. package/dist/components/toast.css +1 -1
  149. package/dist/components/toast.js +90 -115
  150. package/dist/components/toast.min.css +1 -1
  151. package/dist/components/toast.min.js +2 -2
  152. package/dist/components/transition.css +1 -1
  153. package/dist/components/transition.js +86 -141
  154. package/dist/components/transition.min.css +1 -1
  155. package/dist/components/transition.min.js +2 -2
  156. package/dist/components/visibility.js +134 -210
  157. package/dist/components/visibility.min.js +2 -2
  158. package/dist/semantic.css +59 -57
  159. package/dist/semantic.js +4015 -5567
  160. package/dist/semantic.min.css +2 -2
  161. package/dist/semantic.min.js +2 -2
  162. package/examples/assets/show-examples.js +2 -4
  163. package/gulpfile.js +5 -7
  164. package/package.json +1 -1
  165. package/scripts/nightly-version.js +7 -10
  166. package/src/definitions/behaviors/api.js +151 -204
  167. package/src/definitions/behaviors/form.js +324 -428
  168. package/src/definitions/behaviors/state.js +67 -97
  169. package/src/definitions/behaviors/visibility.js +133 -209
  170. package/src/definitions/globals/site.js +37 -56
  171. package/src/definitions/modules/accordion.js +93 -130
  172. package/src/definitions/modules/calendar.js +304 -340
  173. package/src/definitions/modules/checkbox.js +75 -115
  174. package/src/definitions/modules/dimmer.js +57 -90
  175. package/src/definitions/modules/dropdown.js +652 -942
  176. package/src/definitions/modules/dropdown.less +11 -5
  177. package/src/definitions/modules/embed.js +70 -108
  178. package/src/definitions/modules/flyout.js +182 -256
  179. package/src/definitions/modules/modal.js +211 -295
  180. package/src/definitions/modules/nag.js +66 -96
  181. package/src/definitions/modules/popup.js +175 -235
  182. package/src/definitions/modules/progress.js +102 -137
  183. package/src/definitions/modules/rating.js +79 -120
  184. package/src/definitions/modules/search.js +239 -333
  185. package/src/definitions/modules/shape.js +156 -222
  186. package/src/definitions/modules/sidebar.js +121 -162
  187. package/src/definitions/modules/slider.js +241 -324
  188. package/src/definitions/modules/sticky.js +115 -158
  189. package/src/definitions/modules/tab.js +167 -232
  190. package/src/definitions/modules/toast.js +89 -114
  191. package/src/definitions/modules/transition.js +85 -140
  192. package/src/themes/default/modules/dropdown.variables +1 -0
  193. package/tasks/admin/components/create.js +88 -108
  194. package/tasks/admin/components/init.js +26 -32
  195. package/tasks/admin/components/update.js +46 -53
  196. package/tasks/admin/distributions/create.js +71 -101
  197. package/tasks/admin/distributions/init.js +27 -33
  198. package/tasks/admin/distributions/update.js +45 -52
  199. package/tasks/admin/register.js +11 -15
  200. package/tasks/build/assets.js +14 -18
  201. package/tasks/build/css.js +54 -63
  202. package/tasks/build/javascript.js +45 -53
  203. package/tasks/build.js +4 -6
  204. package/tasks/check-install.js +5 -7
  205. package/tasks/clean.js +2 -4
  206. package/tasks/collections/admin.js +13 -15
  207. package/tasks/collections/build.js +6 -8
  208. package/tasks/collections/docs.js +2 -4
  209. package/tasks/collections/install.js +2 -4
  210. package/tasks/collections/rtl.js +2 -4
  211. package/tasks/collections/various.js +2 -4
  212. package/tasks/config/admin/github.js +7 -9
  213. package/tasks/config/admin/templates/css-package.js +1 -3
  214. package/tasks/config/admin/templates/less-package.js +1 -3
  215. package/tasks/config/npm/gulpfile.js +4 -6
  216. package/tasks/config/project/config.js +22 -30
  217. package/tasks/config/project/install.js +56 -70
  218. package/tasks/config/project/release.js +6 -8
  219. package/tasks/config/tasks.js +8 -12
  220. package/tasks/config/user.js +13 -17
  221. package/tasks/docs/build.js +26 -31
  222. package/tasks/docs/metadata.js +24 -30
  223. package/tasks/docs/serve.js +20 -26
  224. package/tasks/install.js +71 -98
  225. package/tasks/rtl/build.js +2 -4
  226. package/tasks/rtl/watch.js +2 -4
  227. package/tasks/watch.js +9 -11
  228. package/test/meteor/fonts.js +1 -2
  229. package/test/modules/module.spec.js +16 -18
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.7+13b1bae - Tab
2
+ * # Fomantic-UI 2.10.0-beta.9+45ac3fe - Tab
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -24,66 +24,62 @@
24
24
  : globalThis;
25
25
 
26
26
  $.fn.tab = function (parameters) {
27
- var
28
- // use window context if none specified
29
- $allModules = isFunction(this)
30
- ? $(window)
31
- : $(this),
32
- $document = $(document),
33
- time = Date.now(),
34
- performance = [],
35
-
36
- query = arguments[0],
37
- methodInvoked = typeof query === 'string',
38
- queryArguments = [].slice.call(arguments, 1),
39
- contextCheck = function (context, win) {
40
- var $context;
41
- if ([window, document].indexOf(context) >= 0) {
42
- $context = $(context);
43
- } else {
44
- $context = $(win.document).find(context);
45
- if ($context.length === 0) {
46
- $context = win.frameElement ? contextCheck(context, win.parent) : window;
47
- }
27
+ // use window context if none specified
28
+ let $allModules = isFunction(this)
29
+ ? $(window)
30
+ : $(this);
31
+ let $document = $(document);
32
+ let time = Date.now();
33
+ let performance = [];
34
+
35
+ let query = arguments[0];
36
+ let methodInvoked = typeof query === 'string';
37
+ let queryArguments = [].slice.call(arguments, 1);
38
+ let contextCheck = function (context, win) {
39
+ let $context;
40
+ if ([window, document].indexOf(context) >= 0) {
41
+ $context = $(context);
42
+ } else {
43
+ $context = $(win.document).find(context);
44
+ if ($context.length === 0) {
45
+ $context = win.frameElement ? contextCheck(context, win.parent) : window;
48
46
  }
47
+ }
49
48
 
50
- return $context;
51
- },
52
- initializedHistory = false,
53
- returnedValue
54
- ;
49
+ return $context;
50
+ };
51
+ let initializedHistory = false;
52
+ let returnedValue;
55
53
 
56
54
  $allModules.each(function () {
57
- var
58
- settings = $.isPlainObject(parameters)
59
- ? $.extend(true, {}, $.fn.tab.settings, parameters)
60
- : $.extend({}, $.fn.tab.settings),
55
+ let settings = $.isPlainObject(parameters)
56
+ ? $.extend(true, {}, $.fn.tab.settings, parameters)
57
+ : $.extend({}, $.fn.tab.settings);
61
58
 
62
- className = settings.className,
63
- metadata = settings.metadata,
64
- selector = settings.selector,
65
- error = settings.error,
66
- regExp = settings.regExp,
59
+ let className = settings.className;
60
+ let metadata = settings.metadata;
61
+ let selector = settings.selector;
62
+ let error = settings.error;
63
+ let regExp = settings.regExp;
67
64
 
68
- eventNamespace = '.' + settings.namespace,
69
- moduleNamespace = 'module-' + settings.namespace,
65
+ let eventNamespace = '.' + settings.namespace;
66
+ let moduleNamespace = 'module-' + settings.namespace;
70
67
 
71
- $module = $(this),
72
- $context,
73
- $tabs,
68
+ let $module = $(this);
69
+ let $context;
70
+ let $tabs;
74
71
 
75
- cache = {},
76
- firstLoad = true,
77
- recursionDepth = 0,
78
- element = this,
79
- instance = $module.data(moduleNamespace),
72
+ let cache = {};
73
+ let firstLoad = true;
74
+ let recursionDepth = 0;
75
+ let element = this;
76
+ let instance = $module.data(moduleNamespace);
80
77
 
81
- activeTabPath,
82
- parameterArray,
83
- module,
78
+ let activeTabPath;
79
+ let parameterArray;
80
+ let module;
84
81
 
85
- historyEvent
86
- ;
82
+ let historyEvent;
87
83
 
88
84
  module = {
89
85
 
@@ -103,14 +99,14 @@
103
99
  initializedHistory = true;
104
100
  }
105
101
 
106
- var activeTab = module.determine.activeTab();
102
+ let activeTab = module.determine.activeTab();
107
103
  if (settings.autoTabActivation && instance === undefined && activeTab === null) {
108
104
  activeTab = settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation;
109
105
  module.debug('No active tab detected, setting tab active', activeTab);
110
106
  module.changeTab(activeTab);
111
107
  }
112
108
  if (activeTab !== null && settings.history && settings.historyType === 'state') {
113
- var autoUpdate = $.address.autoUpdate();
109
+ let autoUpdate = $.address.autoUpdate();
114
110
  $.address.autoUpdate(false);
115
111
  $.address.value(activeTab);
116
112
  $.address.autoUpdate(autoUpdate);
@@ -123,16 +119,14 @@
123
119
  module.verbose('Storing instance of module', module);
124
120
  instance = module;
125
121
  $module
126
- .data(moduleNamespace, module)
127
- ;
122
+ .data(moduleNamespace, module);
128
123
  },
129
124
 
130
125
  destroy: function () {
131
126
  module.debug('Destroying tabs', $module);
132
127
  $module
133
128
  .removeData(moduleNamespace)
134
- .off(eventNamespace)
135
- ;
129
+ .off(eventNamespace);
136
130
  },
137
131
 
138
132
  bind: {
@@ -141,16 +135,13 @@
141
135
  if (!isWindow(element)) {
142
136
  module.debug('Attaching tab activation events to element', $module);
143
137
  $module
144
- .on('click' + eventNamespace, module.event.click)
145
- ;
138
+ .on('click' + eventNamespace, module.event.click);
146
139
  }
147
140
  },
148
141
  },
149
142
 
150
143
  determineTabs: function () {
151
- var
152
- $reference
153
- ;
144
+ let $reference;
154
145
 
155
146
  // determine tab context
156
147
  if (settings.context === 'parent') {
@@ -190,8 +181,7 @@
190
181
  if (settings.path !== false) {
191
182
  $.address
192
183
  .history(true)
193
- .state(settings.path)
194
- ;
184
+ .state(settings.path);
195
185
  $(window).trigger('popstate');
196
186
  } else {
197
187
  module.error(error.path);
@@ -200,17 +190,14 @@
200
190
  }
201
191
  }
202
192
  $.address
203
- .bind('change', module.event.history.change)
204
- ;
193
+ .bind('change', module.event.history.change);
205
194
 
206
195
  return true;
207
196
  },
208
197
 
209
198
  event: {
210
199
  click: function (event) {
211
- var
212
- tabPath = $(this).data(metadata.tab)
213
- ;
200
+ let tabPath = $(this).data(metadata.tab);
214
201
  if (tabPath !== undefined) {
215
202
  if (settings.history) {
216
203
  module.verbose('Updating page state', event);
@@ -226,10 +213,8 @@
226
213
  },
227
214
  history: {
228
215
  change: function (event) {
229
- var
230
- tabPath = event.pathNames.join('/') || module.get.initialPath(),
231
- pageTitle = settings.templates.determineTitle(tabPath) || false
232
- ;
216
+ let tabPath = event.pathNames.join('/') || module.get.initialPath();
217
+ let pageTitle = settings.templates.determineTitle(tabPath) || false;
233
218
  module.performance.display();
234
219
  module.debug('History change event', tabPath, event);
235
220
  historyEvent = event;
@@ -269,21 +254,11 @@
269
254
  },
270
255
  },
271
256
 
272
- escape: {
273
- string: function (text) {
274
- text = String(text);
275
-
276
- return text.replace(regExp.escape, '\\$&');
277
- },
278
- },
279
-
280
257
  set: {
281
258
  auto: function () {
282
- var
283
- url = typeof settings.path === 'string'
284
- ? settings.path.replace(/\/$/, '') + '/{$tab}'
285
- : '/{$tab}'
286
- ;
259
+ let url = typeof settings.path === 'string'
260
+ ? settings.path.replace(/\/$/, '') + '/{$tab}'
261
+ : '/{$tab}';
287
262
  module.verbose('Setting up automatic tab retrieval from server', url);
288
263
  if ($.isPlainObject(settings.apiSettings)) {
289
264
  settings.apiSettings.url = url;
@@ -294,17 +269,14 @@
294
269
  }
295
270
  },
296
271
  loading: function (tabPath) {
297
- var
298
- $tab = module.get.tabElement(tabPath),
299
- isLoading = $tab.hasClass(className.loading)
300
- ;
272
+ let $tab = module.get.tabElement(tabPath);
273
+ let isLoading = $tab.hasClass(className.loading);
301
274
  if (!isLoading) {
302
275
  module.verbose('Setting loading state for', $tab);
303
276
  $tab
304
277
  .addClass(className.loading)
305
278
  .siblings($tabs)
306
- .removeClass(className.active + ' ' + className.loading)
307
- ;
279
+ .removeClass(className.active + ' ' + className.loading);
308
280
  if ($tab.length > 0) {
309
281
  settings.onRequest.call($tab[0], tabPath);
310
282
  }
@@ -316,30 +288,26 @@
316
288
  },
317
289
 
318
290
  changeTab: function (tabPath) {
319
- var
320
- pushStateAvailable = window.history && window.history.pushState,
321
- shouldIgnoreLoad = pushStateAvailable && settings.ignoreFirstLoad && firstLoad,
322
- remoteContent = settings.auto || $.isPlainObject(settings.apiSettings),
323
- // only add the default path if not remote content
324
- pathArray = remoteContent && !shouldIgnoreLoad
325
- ? module.utilities.pathToArray(tabPath)
326
- : module.get.defaultPathArray(tabPath)
327
- ;
291
+ let pushStateAvailable = window.history && window.history.pushState;
292
+ let shouldIgnoreLoad = pushStateAvailable && settings.ignoreFirstLoad && firstLoad;
293
+ let remoteContent = settings.auto || $.isPlainObject(settings.apiSettings);
294
+ // only add the default path if not remote content
295
+ let pathArray = remoteContent && !shouldIgnoreLoad
296
+ ? module.utilities.pathToArray(tabPath)
297
+ : module.get.defaultPathArray(tabPath);
328
298
  tabPath = module.utilities.arrayToPath(pathArray);
329
299
  $.each(pathArray, function (index, tab) {
330
- var
331
- currentPathArray = pathArray.slice(0, index + 1),
332
- currentPath = module.utilities.arrayToPath(currentPathArray),
333
-
334
- isTab = module.is.tab(currentPath),
335
- isLastIndex = index + 1 === pathArray.length,
336
-
337
- $tab = module.get.tabElement(currentPath),
338
- $anchor,
339
- nextPathArray,
340
- nextPath,
341
- isLastTab
342
- ;
300
+ let currentPathArray = pathArray.slice(0, index + 1);
301
+ let currentPath = module.utilities.arrayToPath(currentPathArray);
302
+
303
+ let isTab = module.is.tab(currentPath);
304
+ let isLastIndex = index + 1 === pathArray.length;
305
+
306
+ let $tab = module.get.tabElement(currentPath);
307
+ let $anchor;
308
+ let nextPathArray;
309
+ let nextPath;
310
+ let isLastTab;
343
311
  module.verbose('Looking for tab', tab);
344
312
  if (isTab) {
345
313
  module.verbose('Tab was found', tab);
@@ -388,8 +356,7 @@
388
356
  settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
389
357
  } else if (tabPath.search('/') === -1 && tabPath !== '') {
390
358
  // look for in page anchor
391
- tabPath = module.escape.string(tabPath);
392
- $anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]');
359
+ $anchor = $('#' + CSS.escape(tabPath) + ', a[name="' + CSS.escape(tabPath) + '"]');
393
360
  currentPath = $anchor.closest('[data-tab]').data(metadata.tab);
394
361
  $tab = module.get.tabElement(currentPath);
395
362
  // if anchor exists, use parent tab
@@ -424,11 +391,9 @@
424
391
  },
425
392
 
426
393
  scrollTo: function ($element) {
427
- var
428
- scrollOffset = $element && $element.length > 0
429
- ? $element.offset().top
430
- : false
431
- ;
394
+ let scrollOffset = $element && $element.length > 0
395
+ ? $element.offset().top
396
+ : false;
432
397
  if (scrollOffset !== false) {
433
398
  module.debug('Forcing scroll to an in-page link in a hidden tab', scrollOffset, $element);
434
399
  $document.scrollTop(scrollOffset);
@@ -437,18 +402,15 @@
437
402
 
438
403
  update: {
439
404
  content: function (tabPath, html, evaluateScripts) {
440
- var
441
- $tab = module.get.tabElement(tabPath),
442
- tab = $tab[0]
443
- ;
405
+ let $tab = module.get.tabElement(tabPath);
406
+ let tab = $tab[0];
444
407
  evaluateScripts = evaluateScripts !== undefined
445
408
  ? evaluateScripts
446
409
  : settings.evaluateScripts;
447
410
  if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() === 'dom' && typeof html !== 'string') {
448
411
  $tab
449
412
  .empty()
450
- .append($(html).clone(true))
451
- ;
413
+ .append($(html).clone(true));
452
414
  } else {
453
415
  if (evaluateScripts) {
454
416
  module.debug('Updating HTML and evaluating inline scripts', tabPath, html);
@@ -464,50 +426,46 @@
464
426
  fetch: {
465
427
 
466
428
  content: function (tabPath, fullTabPath) {
467
- var
468
- $tab = module.get.tabElement(tabPath),
469
- apiSettings = {
470
- dataType: 'html',
471
- encodeParameters: false,
472
- on: 'now',
473
- cache: settings.alwaysRefresh,
474
- onSuccess: function (response) {
475
- if (settings.cacheType === 'response') {
476
- module.cache.add(fullTabPath, response);
477
- }
478
- module.update.content(tabPath, response);
479
- if (tabPath == activeTabPath) {
480
- module.debug('Content loaded', tabPath);
481
- module.activate.tab(tabPath);
482
- } else {
483
- module.debug('Content loaded in background', tabPath);
484
- }
485
- settings.onFirstLoad.call($tab[0], tabPath, parameterArray, historyEvent);
486
- settings.onLoad.call($tab[0], tabPath, parameterArray, historyEvent);
487
-
488
- if (settings.loadOnce) {
489
- module.cache.add(fullTabPath, true);
490
- } else if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() === 'dom' && $tab.children().length > 0) {
491
- setTimeout(function () {
492
- var
493
- $clone = $tab.children().clone(true)
494
- ;
495
- $clone = $clone.not('script');
496
- module.cache.add(fullTabPath, $clone);
497
- }, 0);
498
- } else {
499
- module.cache.add(fullTabPath, $tab.html());
500
- }
501
- },
502
- urlData: {
503
- tab: fullTabPath,
504
- },
429
+ let $tab = module.get.tabElement(tabPath);
430
+ let apiSettings = {
431
+ dataType: 'html',
432
+ encodeParameters: false,
433
+ on: 'now',
434
+ cache: settings.alwaysRefresh,
435
+ onSuccess: function (response) {
436
+ if (settings.cacheType === 'response') {
437
+ module.cache.add(fullTabPath, response);
438
+ }
439
+ module.update.content(tabPath, response);
440
+ if (tabPath == activeTabPath) {
441
+ module.debug('Content loaded', tabPath);
442
+ module.activate.tab(tabPath);
443
+ } else {
444
+ module.debug('Content loaded in background', tabPath);
445
+ }
446
+ settings.onFirstLoad.call($tab[0], tabPath, parameterArray, historyEvent);
447
+ settings.onLoad.call($tab[0], tabPath, parameterArray, historyEvent);
448
+
449
+ if (settings.loadOnce) {
450
+ module.cache.add(fullTabPath, true);
451
+ } else if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() === 'dom' && $tab.children().length > 0) {
452
+ setTimeout(function () {
453
+ let $clone = $tab.children().clone(true);
454
+ $clone = $clone.not('script');
455
+ module.cache.add(fullTabPath, $clone);
456
+ }, 0);
457
+ } else {
458
+ module.cache.add(fullTabPath, $tab.html());
459
+ }
460
+ },
461
+ urlData: {
462
+ tab: fullTabPath,
505
463
  },
506
- request = $tab.api('get request') || false,
507
- existingRequest = request && request.state() === 'pending',
508
- requestSettings,
509
- cachedContent
510
- ;
464
+ };
465
+ let request = $tab.api('get request') || false;
466
+ let existingRequest = request && request.state() === 'pending';
467
+ let requestSettings;
468
+ let cachedContent;
511
469
 
512
470
  fullTabPath = fullTabPath || tabPath;
513
471
  cachedContent = module.cache.read(fullTabPath);
@@ -543,42 +501,34 @@
543
501
  module.activate.navigation(tabPath);
544
502
  },
545
503
  tab: function (tabPath) {
546
- var
547
- $tab = module.get.tabElement(tabPath),
548
- $deactiveTabs = settings.deactivate === 'siblings'
549
- ? $tab.siblings($tabs)
550
- : $tabs.not($tab),
551
- isActive = $tab.hasClass(className.active)
552
- ;
504
+ let $tab = module.get.tabElement(tabPath);
505
+ let $deactiveTabs = settings.deactivate === 'siblings'
506
+ ? $tab.siblings($tabs)
507
+ : $tabs.not($tab);
508
+ let isActive = $tab.hasClass(className.active);
553
509
  module.verbose('Showing tab content for', $tab);
554
510
  if (!isActive) {
555
511
  $tab
556
- .addClass(className.active)
557
- ;
512
+ .addClass(className.active);
558
513
  $deactiveTabs
559
- .removeClass(className.active + ' ' + className.loading)
560
- ;
514
+ .removeClass(className.active + ' ' + className.loading);
561
515
  if ($tab.length > 0) {
562
516
  settings.onVisible.call($tab[0], tabPath);
563
517
  }
564
518
  }
565
519
  },
566
520
  navigation: function (tabPath) {
567
- var
568
- $navigation = module.get.navElement(tabPath),
569
- $deactiveNavigation = settings.deactivate === 'siblings'
570
- ? $navigation.siblings($allModules)
571
- : $allModules.not($navigation),
572
- isActive = $navigation.hasClass(className.active)
573
- ;
521
+ let $navigation = module.get.navElement(tabPath);
522
+ let $deactiveNavigation = settings.deactivate === 'siblings'
523
+ ? $navigation.siblings($allModules)
524
+ : $allModules.not($navigation);
525
+ let isActive = $navigation.hasClass(className.active);
574
526
  module.verbose('Activating tab navigation for', $navigation, tabPath);
575
527
  if (!isActive) {
576
528
  $navigation
577
- .addClass(className.active)
578
- ;
529
+ .addClass(className.active);
579
530
  $deactiveNavigation
580
- .removeClass(className.active + ' ' + className.loading)
581
- ;
531
+ .removeClass(className.active + ' ' + className.loading);
582
532
  }
583
533
  },
584
534
  },
@@ -590,13 +540,11 @@
590
540
  },
591
541
  navigation: function () {
592
542
  $allModules
593
- .removeClass(className.active)
594
- ;
543
+ .removeClass(className.active);
595
544
  },
596
545
  tabs: function () {
597
546
  $tabs
598
- .removeClass(className.active + ' ' + className.loading)
599
- ;
547
+ .removeClass(className.active + ' ' + className.loading);
600
548
  },
601
549
  },
602
550
 
@@ -620,10 +568,8 @@
620
568
  return module.utilities.pathToArray(module.get.defaultPath(tabPath));
621
569
  },
622
570
  defaultPath: function (tabPath) {
623
- var
624
- $defaultNav = $allModules.filter('[data-' + metadata.tab + '^="' + module.escape.string(tabPath) + '/"]').eq(0),
625
- defaultTab = $defaultNav.data(metadata.tab) || false
626
- ;
571
+ let $defaultNav = $allModules.filter('[data-' + metadata.tab + '^="' + CSS.escape(tabPath) + '/"]').eq(0);
572
+ let defaultTab = $defaultNav.data(metadata.tab) || false;
627
573
  if (defaultTab) {
628
574
  module.debug('Found default tab', defaultTab);
629
575
  if (recursionDepth < settings.maxDepth) {
@@ -642,20 +588,18 @@
642
588
  navElement: function (tabPath) {
643
589
  tabPath = tabPath || activeTabPath;
644
590
 
645
- return $allModules.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]');
591
+ return $allModules.filter('[data-' + metadata.tab + '="' + CSS.escape(tabPath) + '"]');
646
592
  },
647
593
  tabElement: function (tabPath) {
648
- var
649
- $fullPathTab,
650
- $simplePathTab,
651
- tabPathArray,
652
- lastTab
653
- ;
594
+ let $fullPathTab;
595
+ let $simplePathTab;
596
+ let tabPathArray;
597
+ let lastTab;
654
598
  tabPath = tabPath || activeTabPath;
655
599
  tabPathArray = module.utilities.pathToArray(tabPath);
656
600
  lastTab = module.utilities.last(tabPathArray);
657
- $fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]');
658
- $simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + module.escape.string(lastTab) + '"]');
601
+ $fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + CSS.escape(tabPath) + '"]');
602
+ $simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + CSS.escape(lastTab) + '"]');
659
603
 
660
604
  return $fullPathTab.length > 0
661
605
  ? $fullPathTab
@@ -668,16 +612,14 @@
668
612
 
669
613
  determine: {
670
614
  activeTab: function () {
671
- var activeTab = null;
615
+ let activeTab = null;
672
616
 
673
617
  $tabs.each(function (_index, tab) {
674
- var $tab = $(tab);
618
+ let $tab = $(tab);
675
619
 
676
620
  if ($tab.hasClass(className.active)) {
677
- var
678
- tabPath = $(this).data(metadata.tab),
679
- $anchor = $allModules.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]')
680
- ;
621
+ let tabPath = $(this).data(metadata.tab);
622
+ let $anchor = $allModules.filter('[data-' + metadata.tab + '="' + CSS.escape(tabPath) + '"]');
681
623
 
682
624
  if ($anchor.hasClass(className.active)) {
683
625
  activeTab = tabPath;
@@ -767,11 +709,9 @@
767
709
  },
768
710
  performance: {
769
711
  log: function (message) {
770
- var
771
- currentTime,
772
- executionTime,
773
- previousTime
774
- ;
712
+ let currentTime;
713
+ let executionTime;
714
+ let previousTime;
775
715
  if (settings.performance) {
776
716
  currentTime = Date.now();
777
717
  previousTime = time || currentTime;
@@ -790,10 +730,8 @@
790
730
  }, 500);
791
731
  },
792
732
  display: function () {
793
- var
794
- title = settings.name + ':',
795
- totalTime = 0
796
- ;
733
+ let title = settings.name + ':';
734
+ let totalTime = 0;
797
735
  time = false;
798
736
  clearTimeout(module.performance.timer);
799
737
  $.each(performance, function (index, data) {
@@ -815,22 +753,19 @@
815
753
  },
816
754
  },
817
755
  invoke: function (query, passedArguments, context) {
818
- var
819
- object = instance,
820
- maxDepth,
821
- found,
822
- response
823
- ;
756
+ let object = instance;
757
+ let maxDepth;
758
+ let found;
759
+ let response;
824
760
  passedArguments = passedArguments || queryArguments;
825
761
  context = context || element;
826
762
  if (typeof query === 'string' && object !== undefined) {
827
763
  query = query.split(/[ .]/);
828
764
  maxDepth = query.length - 1;
829
765
  $.each(query, function (depth, value) {
830
- var camelCaseValue = depth !== maxDepth
766
+ let camelCaseValue = depth !== maxDepth
831
767
  ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
832
- : query
833
- ;
768
+ : query;
834
769
  if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
835
770
  object = object[camelCaseValue];
836
771
  } else if (object[camelCaseValue] !== undefined) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.7+13b1bae - Tab
2
+ * # Fomantic-UI 2.10.0-beta.9+45ac3fe - Tab
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *