fomantic-ui 2.9.1-beta.23 → 2.9.1-beta.25
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.
- package/.eslint/eqeqeq-rule.js +18 -0
- package/.eslint/index.js +26 -0
- package/.eslint/no-extra-parens-rule.js +17 -0
- package/.eslint/package.json +11 -0
- package/.eslintrc.js +7 -13
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +24 -24
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +58 -58
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +84 -72
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +17 -17
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +18 -18
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +264 -254
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +19 -19
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +29 -25
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +158 -141
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +32 -28
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +10 -10
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +79 -71
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +40 -42
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +13 -13
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +42 -42
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +36 -36
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +29 -29
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +16 -16
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +79 -58
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +14 -14
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +25 -25
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +34 -34
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +43 -19
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +26 -26
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +29 -29
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +50 -50
- package/dist/semantic.js +1218 -1120
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/gulpfile.js +1 -1
- package/package.json +2 -1
- package/scripts/nightly-version.js +3 -1
- package/src/definitions/behaviors/api.js +57 -57
- package/src/definitions/behaviors/form.js +157 -140
- package/src/definitions/behaviors/state.js +13 -13
- package/src/definitions/behaviors/visibility.js +28 -28
- package/src/definitions/globals/site.js +15 -15
- package/src/definitions/modules/accordion.js +23 -23
- package/src/definitions/modules/calendar.js +83 -71
- package/src/definitions/modules/checkbox.js +16 -16
- package/src/definitions/modules/dimmer.js +17 -17
- package/src/definitions/modules/dropdown.js +263 -253
- package/src/definitions/modules/embed.js +18 -18
- package/src/definitions/modules/flyout.js +28 -24
- package/src/definitions/modules/modal.js +31 -27
- package/src/definitions/modules/nag.js +9 -9
- package/src/definitions/modules/popup.js +78 -70
- package/src/definitions/modules/progress.js +39 -41
- package/src/definitions/modules/rating.js +12 -12
- package/src/definitions/modules/search.js +41 -41
- package/src/definitions/modules/shape.js +35 -35
- package/src/definitions/modules/sidebar.js +28 -28
- package/src/definitions/modules/slider.js +78 -57
- package/src/definitions/modules/sticky.js +24 -24
- package/src/definitions/modules/tab.js +33 -33
- package/src/definitions/modules/toast.js +42 -18
- package/src/definitions/modules/transition.js +25 -25
- package/tasks/admin/components/create.js +1 -1
- package/tasks/admin/components/init.js +2 -2
- package/tasks/admin/components/update.js +4 -4
- package/tasks/admin/distributions/create.js +6 -7
- package/tasks/admin/distributions/init.js +2 -2
- package/tasks/admin/distributions/update.js +4 -4
- package/tasks/admin/publish.js +1 -3
- package/tasks/admin/register.js +5 -5
- package/tasks/admin/release.js +1 -3
- package/tasks/build/assets.js +1 -1
- package/tasks/build.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/admin.js +1 -1
- package/tasks/collections/rtl.js +1 -1
- package/tasks/config/admin/github.js +3 -4
- package/tasks/config/npm/gulpfile.js +1 -1
- package/tasks/config/project/config.js +10 -8
- package/tasks/config/project/install.js +14 -14
- package/tasks/config/project/release.js +3 -2
- package/tasks/config/tasks.js +4 -4
- package/tasks/config/user.js +5 -3
- package/tasks/docs/build.js +1 -1
- package/tasks/docs/metadata.js +2 -2
- package/tasks/docs/serve.js +2 -1
- package/tasks/install.js +3 -3
- package/tasks/rtl/build.js +1 -3
- package/tasks/rtl/watch.js +1 -3
- package/tasks/version.js +1 -3
- package/tasks/watch.js +1 -1
- package/test/modules/module.spec.js +1 -1
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window =
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -29,14 +29,14 @@
|
|
29
29
|
performance = [],
|
30
30
|
|
31
31
|
query = arguments[0],
|
32
|
-
methodInvoked =
|
32
|
+
methodInvoked = typeof query === 'string',
|
33
33
|
queryArguments = [].slice.call(arguments, 1),
|
34
34
|
|
35
35
|
returnedValue
|
36
36
|
;
|
37
37
|
$allModules.each(function () {
|
38
38
|
var
|
39
|
-
settings =
|
39
|
+
settings = $.isPlainObject(parameters)
|
40
40
|
? $.extend(true, {}, $.fn.state.settings, parameters)
|
41
41
|
: $.extend({}, $.fn.state.settings),
|
42
42
|
|
@@ -130,7 +130,7 @@
|
|
130
130
|
return $module.hasClass(className.loading);
|
131
131
|
},
|
132
132
|
inactive: function () {
|
133
|
-
return
|
133
|
+
return !$module.hasClass(className.active);
|
134
134
|
},
|
135
135
|
state: function (state) {
|
136
136
|
if (className[state] === undefined) {
|
@@ -141,13 +141,13 @@
|
|
141
141
|
},
|
142
142
|
|
143
143
|
enabled: function () {
|
144
|
-
return
|
144
|
+
return !$module.is(settings.filter.active);
|
145
145
|
},
|
146
146
|
disabled: function () {
|
147
|
-
return
|
147
|
+
return $module.is(settings.filter.active);
|
148
148
|
},
|
149
149
|
textEnabled: function () {
|
150
|
-
return
|
150
|
+
return !$module.is(settings.filter.text);
|
151
151
|
},
|
152
152
|
|
153
153
|
// definitions for automatic type detection
|
@@ -233,7 +233,7 @@
|
|
233
233
|
}
|
234
234
|
$.when(apiRequest)
|
235
235
|
.then(function () {
|
236
|
-
if (apiRequest.state()
|
236
|
+
if (apiRequest.state() === 'resolved') {
|
237
237
|
module.debug('API request succeeded');
|
238
238
|
settings.activateTest = function () {
|
239
239
|
return true;
|
@@ -339,7 +339,7 @@
|
|
339
339
|
|
340
340
|
get: {
|
341
341
|
text: function () {
|
342
|
-
return
|
342
|
+
return settings.selector.text
|
343
343
|
? $module.find(settings.selector.text).text()
|
344
344
|
: $module.html();
|
345
345
|
},
|
@@ -519,17 +519,17 @@
|
|
519
519
|
query = query.split(/[ .]/);
|
520
520
|
maxDepth = query.length - 1;
|
521
521
|
$.each(query, function (depth, value) {
|
522
|
-
var camelCaseValue =
|
522
|
+
var camelCaseValue = depth !== maxDepth
|
523
523
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
524
524
|
: query
|
525
525
|
;
|
526
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
526
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
527
527
|
object = object[camelCaseValue];
|
528
528
|
} else if (object[camelCaseValue] !== undefined) {
|
529
529
|
found = object[camelCaseValue];
|
530
530
|
|
531
531
|
return false;
|
532
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
532
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
533
533
|
object = object[value];
|
534
534
|
} else if (object[value] !== undefined) {
|
535
535
|
found = object[value];
|
@@ -572,7 +572,7 @@
|
|
572
572
|
}
|
573
573
|
});
|
574
574
|
|
575
|
-
return
|
575
|
+
return returnedValue !== undefined
|
576
576
|
? returnedValue
|
577
577
|
: this;
|
578
578
|
};
|
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window =
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
performance = [],
|
29
29
|
|
30
30
|
query = arguments[0],
|
31
|
-
methodInvoked =
|
31
|
+
methodInvoked = typeof query === 'string',
|
32
32
|
queryArguments = [].slice.call(arguments, 1),
|
33
33
|
returnedValue,
|
34
34
|
|
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
$allModules.each(function () {
|
40
40
|
var
|
41
|
-
settings =
|
41
|
+
settings = $.isPlainObject(parameters)
|
42
42
|
? $.extend(true, {}, $.fn.visibility.settings, parameters)
|
43
43
|
: $.extend({}, $.fn.visibility.settings),
|
44
44
|
|
@@ -83,10 +83,10 @@
|
|
83
83
|
module.setup.cache();
|
84
84
|
|
85
85
|
if (module.should.trackChanges()) {
|
86
|
-
if (settings.type
|
86
|
+
if (settings.type === 'image') {
|
87
87
|
module.setup.image();
|
88
88
|
}
|
89
|
-
if (settings.type
|
89
|
+
if (settings.type === 'fixed') {
|
90
90
|
module.setup.fixed();
|
91
91
|
}
|
92
92
|
|
@@ -131,7 +131,7 @@
|
|
131
131
|
.off('scroll' + eventNamespace, module.event.scroll)
|
132
132
|
.off('scrollchange' + eventNamespace, module.event.scrollchange)
|
133
133
|
;
|
134
|
-
if (settings.type
|
134
|
+
if (settings.type === 'fixed') {
|
135
135
|
module.resetFixed();
|
136
136
|
module.remove.placeholder();
|
137
137
|
}
|
@@ -189,7 +189,7 @@
|
|
189
189
|
[].forEach.call(mutations, function (mutation) {
|
190
190
|
if (mutation.removedNodes) {
|
191
191
|
[].forEach.call(mutation.removedNodes, function (node) {
|
192
|
-
if (node
|
192
|
+
if (node === element || $(node).find(element).length > 0) {
|
193
193
|
module.debug('Element removed from DOM, tearing down events');
|
194
194
|
module.destroy();
|
195
195
|
}
|
@@ -227,7 +227,7 @@
|
|
227
227
|
},
|
228
228
|
|
229
229
|
precache: function (images, callback) {
|
230
|
-
if (!
|
230
|
+
if (!Array.isArray(images)) {
|
231
231
|
images = [images];
|
232
232
|
}
|
233
233
|
var
|
@@ -299,7 +299,7 @@
|
|
299
299
|
module.precache(src, function () {
|
300
300
|
module.set.image(src, function () {
|
301
301
|
loadedCount++;
|
302
|
-
if (loadedCount
|
302
|
+
if (loadedCount === moduleCount) {
|
303
303
|
settings.onAllLoaded.call(this);
|
304
304
|
}
|
305
305
|
settings.onLoad.call(this);
|
@@ -427,27 +427,27 @@
|
|
427
427
|
},
|
428
428
|
verticallyScrollableContext: function () {
|
429
429
|
var
|
430
|
-
overflowY =
|
430
|
+
overflowY = $context[0] !== window
|
431
431
|
? $context.css('overflow-y')
|
432
432
|
: false
|
433
433
|
;
|
434
434
|
|
435
|
-
return
|
435
|
+
return overflowY === 'auto' || overflowY === 'scroll';
|
436
436
|
},
|
437
437
|
horizontallyScrollableContext: function () {
|
438
438
|
var
|
439
|
-
overflowX =
|
439
|
+
overflowX = $context[0] !== window
|
440
440
|
? $context.css('overflow-x')
|
441
441
|
: false
|
442
442
|
;
|
443
443
|
|
444
|
-
return
|
444
|
+
return overflowX === 'auto' || overflowX === 'scroll';
|
445
445
|
},
|
446
446
|
},
|
447
447
|
|
448
448
|
refresh: function () {
|
449
449
|
module.debug('Refreshing constants (width/height)');
|
450
|
-
if (settings.type
|
450
|
+
if (settings.type === 'fixed') {
|
451
451
|
module.resetFixed();
|
452
452
|
}
|
453
453
|
module.reset();
|
@@ -515,7 +515,7 @@
|
|
515
515
|
if (amount && newCallback) {
|
516
516
|
settings.onPassed[amount] = newCallback;
|
517
517
|
} else if (amount !== undefined) {
|
518
|
-
return
|
518
|
+
return module.get.pixelsPassed(amount) > calculations.pixelsPassed;
|
519
519
|
} else if (calculations.passing) {
|
520
520
|
$.each(settings.onPassed, function (amount, callback) {
|
521
521
|
if (calculations.bottomVisible || calculations.pixelsPassed > module.get.pixelsPassed(amount)) {
|
@@ -873,7 +873,7 @@
|
|
873
873
|
;
|
874
874
|
module.verbose('Saving element position');
|
875
875
|
// (quicker than $.extend)
|
876
|
-
element.fits =
|
876
|
+
element.fits = element.height < screen.height;
|
877
877
|
element.offset = $module.offset();
|
878
878
|
element.width = $module.outerWidth();
|
879
879
|
element.height = $module.outerHeight();
|
@@ -907,21 +907,21 @@
|
|
907
907
|
}
|
908
908
|
|
909
909
|
// visibility
|
910
|
-
element.topPassed =
|
911
|
-
element.bottomPassed =
|
910
|
+
element.topPassed = screen.top >= element.top;
|
911
|
+
element.bottomPassed = screen.top >= element.bottom;
|
912
912
|
element.topVisible = (screen.bottom >= element.top) && !element.topPassed;
|
913
913
|
element.bottomVisible = (screen.bottom >= element.bottom) && !element.bottomPassed;
|
914
914
|
element.pixelsPassed = 0;
|
915
915
|
element.percentagePassed = 0;
|
916
916
|
|
917
917
|
// meta calculations
|
918
|
-
element.onScreen = (
|
919
|
-
element.passing =
|
920
|
-
element.offScreen =
|
918
|
+
element.onScreen = (element.topVisible || element.passing) && !element.bottomPassed;
|
919
|
+
element.passing = element.topPassed && !element.bottomPassed;
|
920
|
+
element.offScreen = !element.onScreen;
|
921
921
|
|
922
922
|
// passing calculations
|
923
923
|
if (element.passing) {
|
924
|
-
element.pixelsPassed =
|
924
|
+
element.pixelsPassed = screen.top - element.top;
|
925
925
|
element.percentagePassed = (screen.top - element.top) / element.height;
|
926
926
|
}
|
927
927
|
module.cache.element = element;
|
@@ -957,13 +957,13 @@
|
|
957
957
|
element = module.get.elementCalculations()
|
958
958
|
;
|
959
959
|
if (amount.search('%') > -1) {
|
960
|
-
return
|
960
|
+
return element.height * (parseInt(amount, 10) / 100);
|
961
961
|
}
|
962
962
|
|
963
963
|
return parseInt(amount, 10);
|
964
964
|
},
|
965
965
|
occurred: function (callback) {
|
966
|
-
return
|
966
|
+
return module.cache.occurred !== undefined
|
967
967
|
? module.cache.occurred[callback] || false
|
968
968
|
: false;
|
969
969
|
},
|
@@ -1127,17 +1127,17 @@
|
|
1127
1127
|
query = query.split(/[ .]/);
|
1128
1128
|
maxDepth = query.length - 1;
|
1129
1129
|
$.each(query, function (depth, value) {
|
1130
|
-
var camelCaseValue =
|
1130
|
+
var camelCaseValue = depth !== maxDepth
|
1131
1131
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
1132
1132
|
: query
|
1133
1133
|
;
|
1134
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
1134
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
1135
1135
|
object = object[camelCaseValue];
|
1136
1136
|
} else if (object[camelCaseValue] !== undefined) {
|
1137
1137
|
found = object[camelCaseValue];
|
1138
1138
|
|
1139
1139
|
return false;
|
1140
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
1140
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
1141
1141
|
object = object[value];
|
1142
1142
|
} else if (object[value] !== undefined) {
|
1143
1143
|
found = object[value];
|
@@ -1182,7 +1182,7 @@
|
|
1182
1182
|
}
|
1183
1183
|
});
|
1184
1184
|
|
1185
|
-
return
|
1185
|
+
return returnedValue !== undefined
|
1186
1186
|
? returnedValue
|
1187
1187
|
: this;
|
1188
1188
|
};
|
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window =
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -25,10 +25,10 @@
|
|
25
25
|
performance = [],
|
26
26
|
|
27
27
|
query = arguments[0],
|
28
|
-
methodInvoked =
|
28
|
+
methodInvoked = typeof query === 'string',
|
29
29
|
queryArguments = [].slice.call(arguments, 1),
|
30
30
|
|
31
|
-
settings =
|
31
|
+
settings = $.isPlainObject(parameters)
|
32
32
|
? $.extend(true, {}, $.site.settings, parameters)
|
33
33
|
: $.extend({}, $.site.settings),
|
34
34
|
|
@@ -102,7 +102,7 @@
|
|
102
102
|
},
|
103
103
|
|
104
104
|
moduleExists: function (name) {
|
105
|
-
return
|
105
|
+
return $.fn[name] !== undefined && $.fn[name].settings !== undefined;
|
106
106
|
},
|
107
107
|
|
108
108
|
enabled: {
|
@@ -139,17 +139,17 @@
|
|
139
139
|
|
140
140
|
change: {
|
141
141
|
setting: function (setting, value, modules, modifyExisting) {
|
142
|
-
modules =
|
143
|
-
? (modules === 'all'
|
142
|
+
modules = typeof modules === 'string'
|
143
|
+
? (modules === 'all'
|
144
144
|
? settings.modules
|
145
|
-
: [modules]
|
145
|
+
: [modules])
|
146
146
|
: modules || settings.modules;
|
147
|
-
modifyExisting =
|
147
|
+
modifyExisting = modifyExisting !== undefined
|
148
148
|
? modifyExisting
|
149
149
|
: true;
|
150
150
|
$.each(modules, function (index, name) {
|
151
151
|
var
|
152
|
-
namespace =
|
152
|
+
namespace = module.moduleExists(name)
|
153
153
|
? $.fn[name].settings.namespace || false
|
154
154
|
: true,
|
155
155
|
$existingModules
|
@@ -168,10 +168,10 @@
|
|
168
168
|
});
|
169
169
|
},
|
170
170
|
settings: function (newSettings, modules, modifyExisting) {
|
171
|
-
modules =
|
171
|
+
modules = typeof modules === 'string'
|
172
172
|
? [modules]
|
173
173
|
: modules || settings.modules;
|
174
|
-
modifyExisting =
|
174
|
+
modifyExisting = modifyExisting !== undefined
|
175
175
|
? modifyExisting
|
176
176
|
: true;
|
177
177
|
$.each(modules, function (index, name) {
|
@@ -361,17 +361,17 @@
|
|
361
361
|
query = query.split(/[ .]/);
|
362
362
|
maxDepth = query.length - 1;
|
363
363
|
$.each(query, function (depth, value) {
|
364
|
-
var camelCaseValue =
|
364
|
+
var camelCaseValue = depth !== maxDepth
|
365
365
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
366
366
|
: query
|
367
367
|
;
|
368
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
368
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
369
369
|
object = object[camelCaseValue];
|
370
370
|
} else if (object[camelCaseValue] !== undefined) {
|
371
371
|
found = object[camelCaseValue];
|
372
372
|
|
373
373
|
return false;
|
374
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
374
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
375
375
|
object = object[value];
|
376
376
|
} else if (object[value] !== undefined) {
|
377
377
|
found = object[value];
|
@@ -413,7 +413,7 @@
|
|
413
413
|
module.initialize();
|
414
414
|
}
|
415
415
|
|
416
|
-
return
|
416
|
+
return returnedValue !== undefined
|
417
417
|
? returnedValue
|
418
418
|
: this;
|
419
419
|
};
|
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window =
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -27,14 +27,14 @@
|
|
27
27
|
performance = [],
|
28
28
|
|
29
29
|
query = arguments[0],
|
30
|
-
methodInvoked =
|
30
|
+
methodInvoked = typeof query === 'string',
|
31
31
|
queryArguments = [].slice.call(arguments, 1),
|
32
32
|
|
33
33
|
returnedValue
|
34
34
|
;
|
35
35
|
$allModules.each(function () {
|
36
36
|
var
|
37
|
-
settings =
|
37
|
+
settings = $.isPlainObject(parameters)
|
38
38
|
? $.extend(true, {}, $.fn.accordion.settings, parameters)
|
39
39
|
: $.extend({}, $.fn.accordion.settings),
|
40
40
|
|
@@ -121,16 +121,16 @@
|
|
121
121
|
|
122
122
|
toggle: function (query) {
|
123
123
|
var
|
124
|
-
$activeTitle =
|
125
|
-
? (typeof query === 'number'
|
124
|
+
$activeTitle = query !== undefined
|
125
|
+
? (typeof query === 'number'
|
126
126
|
? $title.eq(query)
|
127
|
-
: $(query).closest(selector.title)
|
127
|
+
: $(query).closest(selector.title))
|
128
128
|
: $(this).closest(selector.title),
|
129
129
|
$activeContent = $activeTitle.next($content),
|
130
130
|
isAnimating = $activeContent.hasClass(className.animating),
|
131
131
|
isActive = $activeContent.hasClass(className.active),
|
132
|
-
isOpen =
|
133
|
-
isOpening =
|
132
|
+
isOpen = isActive && !isAnimating,
|
133
|
+
isOpening = !isActive && isAnimating
|
134
134
|
;
|
135
135
|
module.debug('Toggling visibility of content', $activeTitle);
|
136
136
|
if (isOpen || isOpening) {
|
@@ -146,15 +146,15 @@
|
|
146
146
|
|
147
147
|
open: function (query) {
|
148
148
|
var
|
149
|
-
$activeTitle =
|
150
|
-
? (typeof query === 'number'
|
149
|
+
$activeTitle = query !== undefined
|
150
|
+
? (typeof query === 'number'
|
151
151
|
? $title.eq(query)
|
152
|
-
: $(query).closest(selector.title)
|
152
|
+
: $(query).closest(selector.title))
|
153
153
|
: $(this).closest(selector.title),
|
154
154
|
$activeContent = $activeTitle.next($content),
|
155
155
|
isAnimating = $activeContent.hasClass(className.animating),
|
156
156
|
isActive = $activeContent.hasClass(className.active),
|
157
|
-
isOpen =
|
157
|
+
isOpen = isActive || isAnimating
|
158
158
|
;
|
159
159
|
if (isOpen) {
|
160
160
|
module.debug('Accordion already open, skipping', $activeContent);
|
@@ -216,16 +216,16 @@
|
|
216
216
|
|
217
217
|
close: function (query) {
|
218
218
|
var
|
219
|
-
$activeTitle =
|
220
|
-
? (typeof query === 'number'
|
219
|
+
$activeTitle = query !== undefined
|
220
|
+
? (typeof query === 'number'
|
221
221
|
? $title.eq(query)
|
222
|
-
: $(query).closest(selector.title)
|
222
|
+
: $(query).closest(selector.title))
|
223
223
|
: $(this).closest(selector.title),
|
224
224
|
$activeContent = $activeTitle.next($content),
|
225
225
|
isAnimating = $activeContent.hasClass(className.animating),
|
226
226
|
isActive = $activeContent.hasClass(className.active),
|
227
|
-
isOpening =
|
228
|
-
isClosing =
|
227
|
+
isOpening = !isActive && isAnimating,
|
228
|
+
isClosing = isActive && isAnimating
|
229
229
|
;
|
230
230
|
if ((isActive || isOpening) && !isClosing) {
|
231
231
|
module.debug('Closing accordion content', $activeContent);
|
@@ -278,7 +278,7 @@
|
|
278
278
|
|
279
279
|
closeOthers: function (index) {
|
280
280
|
var
|
281
|
-
$activeTitle =
|
281
|
+
$activeTitle = index !== undefined
|
282
282
|
? $title.eq(index)
|
283
283
|
: $(this).closest(selector.title),
|
284
284
|
$parentTitles = $activeTitle.parents(selector.content).prev(selector.title),
|
@@ -298,7 +298,7 @@
|
|
298
298
|
$openTitles = $openTitles.not($nestedTitles);
|
299
299
|
$openContents = $openTitles.next($content);
|
300
300
|
}
|
301
|
-
if (
|
301
|
+
if ($openTitles.length > 0) {
|
302
302
|
module.debug('Exclusive enabled, closing other content', $openTitles);
|
303
303
|
$openTitles
|
304
304
|
.removeClass(className.active)
|
@@ -482,16 +482,16 @@
|
|
482
482
|
query = query.split(/[ .]/);
|
483
483
|
maxDepth = query.length - 1;
|
484
484
|
$.each(query, function (depth, value) {
|
485
|
-
var camelCaseValue =
|
485
|
+
var camelCaseValue = depth !== maxDepth
|
486
486
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
487
487
|
: query;
|
488
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
488
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
489
489
|
object = object[camelCaseValue];
|
490
490
|
} else if (object[camelCaseValue] !== undefined) {
|
491
491
|
found = object[camelCaseValue];
|
492
492
|
|
493
493
|
return false;
|
494
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
494
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
495
495
|
object = object[value];
|
496
496
|
} else if (object[value] !== undefined) {
|
497
497
|
found = object[value];
|
@@ -533,7 +533,7 @@
|
|
533
533
|
}
|
534
534
|
});
|
535
535
|
|
536
|
-
return
|
536
|
+
return returnedValue !== undefined
|
537
537
|
? returnedValue
|
538
538
|
: this;
|
539
539
|
};
|