fomantic-ui 2.10.0-beta.62 → 2.10.0-beta.64
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/.eslintrc.js +0 -1
- package/changelog-setup.js +10 -10
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +40 -41
- 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 +57 -61
- 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 +186 -187
- 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 +29 -30
- 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 +22 -23
- 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 +293 -337
- 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 +33 -35
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- 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 +74 -81
- 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 +141 -146
- 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/menu.css +1 -1
- package/dist/components/menu.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 +80 -81
- 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 +27 -28
- 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 +62 -72
- 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 +51 -55
- 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 +33 -34
- 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 +96 -109
- 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 +44 -45
- 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 +56 -64
- 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 -17
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +143 -148
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +24 -25
- 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 +42 -43
- 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 +57 -66
- 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 +32 -33
- 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 +38 -45
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +76 -77
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +53 -53
- package/dist/semantic.js +1753 -1884
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/scripts/nightly-version.js +3 -3
- package/src/definitions/behaviors/api.js +56 -60
- package/src/definitions/behaviors/form.js +140 -145
- package/src/definitions/behaviors/state.js +23 -24
- package/src/definitions/behaviors/visibility.js +75 -76
- package/src/definitions/globals/site.js +15 -16
- package/src/definitions/modules/accordion.js +39 -40
- package/src/definitions/modules/calendar.js +185 -186
- package/src/definitions/modules/checkbox.js +28 -29
- package/src/definitions/modules/dimmer.js +21 -22
- package/src/definitions/modules/dropdown.js +292 -336
- package/src/definitions/modules/embed.js +32 -34
- package/src/definitions/modules/flyout.js +73 -80
- package/src/definitions/modules/modal.js +79 -80
- package/src/definitions/modules/nag.js +26 -27
- package/src/definitions/modules/popup.js +61 -71
- package/src/definitions/modules/progress.js +50 -54
- package/src/definitions/modules/rating.js +32 -33
- package/src/definitions/modules/search.js +95 -108
- package/src/definitions/modules/shape.js +43 -44
- package/src/definitions/modules/sidebar.js +55 -63
- package/src/definitions/modules/slider.js +142 -147
- package/src/definitions/modules/sticky.js +41 -42
- package/src/definitions/modules/tab.js +56 -65
- package/src/definitions/modules/toast.js +31 -32
- package/src/definitions/modules/transition.js +37 -44
- package/tasks/admin/components/create.js +11 -11
- package/tasks/admin/components/init.js +11 -12
- package/tasks/admin/components/update.js +19 -20
- package/tasks/admin/distributions/create.js +24 -36
- package/tasks/admin/distributions/init.js +11 -12
- package/tasks/admin/distributions/update.js +18 -19
- package/tasks/admin/register.js +7 -7
- package/tasks/build/assets.js +1 -1
- package/tasks/build/css.js +1 -1
- package/tasks/build/javascript.js +1 -1
- package/tasks/config/admin/github.js +1 -1
- package/tasks/config/admin/templates/css-package.js +1 -1
- package/tasks/config/admin/templates/less-package.js +1 -1
- package/tasks/config/project/config.js +6 -6
- package/tasks/config/project/install.js +12 -12
- package/tasks/config/project/release.js +5 -11
- package/tasks/config/tasks.js +5 -5
- package/tasks/config/user.js +1 -4
- package/tasks/docs/metadata.js +11 -12
- package/tasks/install.js +9 -9
- package/test/meteor/assets.js +1 -1
- package/test/modules/module.spec.js +18 -18
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
: globalThis;
|
|
21
21
|
|
|
22
22
|
$.fn.state = function (...args) {
|
|
23
|
-
|
|
23
|
+
const $allModules = $(this);
|
|
24
24
|
|
|
25
25
|
let time = Date.now();
|
|
26
26
|
let performance = [];
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const parameters = args[0];
|
|
29
|
+
const methodInvoked = typeof parameters === 'string';
|
|
30
|
+
const queryArguments = args.slice(1);
|
|
31
|
+
const contextCheck = function (context, win) {
|
|
32
32
|
let $context;
|
|
33
33
|
if ([window, document].includes(context)) {
|
|
34
34
|
$context = $(context);
|
|
@@ -43,28 +43,27 @@
|
|
|
43
43
|
};
|
|
44
44
|
let returnedValue;
|
|
45
45
|
$allModules.each(function () {
|
|
46
|
-
|
|
46
|
+
const settings = $.isPlainObject(parameters)
|
|
47
47
|
? $.extend(true, {}, $.fn.state.settings, parameters)
|
|
48
48
|
: $.extend({}, $.fn.state.settings);
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
const error = settings.error;
|
|
51
|
+
const metadata = settings.metadata;
|
|
52
|
+
const className = settings.className;
|
|
53
|
+
const namespace = settings.namespace;
|
|
54
|
+
const states = settings.states;
|
|
55
|
+
const text = settings.text;
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const eventNamespace = '.' + namespace;
|
|
58
|
+
const moduleNamespace = namespace + '-module';
|
|
59
59
|
|
|
60
60
|
let $module = $(this);
|
|
61
|
-
|
|
61
|
+
const $context = settings.context ? contextCheck(settings.context, window) : $module;
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
const element = this;
|
|
64
64
|
let instance = $module.data(moduleNamespace);
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
module = {
|
|
66
|
+
const module = {
|
|
68
67
|
|
|
69
68
|
initialize: function () {
|
|
70
69
|
module.verbose('Initializing module');
|
|
@@ -105,7 +104,7 @@
|
|
|
105
104
|
|
|
106
105
|
add: {
|
|
107
106
|
defaults: function () {
|
|
108
|
-
|
|
107
|
+
const userStates = parameters && $.isPlainObject(parameters.states)
|
|
109
108
|
? parameters.states
|
|
110
109
|
: {};
|
|
111
110
|
$.each(settings.defaults, function (type, typeStates) {
|
|
@@ -337,7 +336,7 @@
|
|
|
337
336
|
|
|
338
337
|
flash: {
|
|
339
338
|
text: function (text = settings.text.flash, duration = settings.flashDuration, callback = function () {}) {
|
|
340
|
-
|
|
339
|
+
const previousText = module.get.text();
|
|
341
340
|
module.debug('Flashing text message', text, duration);
|
|
342
341
|
module.update.text(text);
|
|
343
342
|
setTimeout(function () {
|
|
@@ -350,8 +349,8 @@
|
|
|
350
349
|
reset: {
|
|
351
350
|
// on mouseout sets text to previous value
|
|
352
351
|
text: function () {
|
|
353
|
-
|
|
354
|
-
|
|
352
|
+
const activeText = text.active || $module.data(metadata.storedText);
|
|
353
|
+
const inactiveText = text.inactive || $module.data(metadata.storedText);
|
|
355
354
|
if (module.is.textEnabled()) {
|
|
356
355
|
if (module.is.active() && activeText) {
|
|
357
356
|
module.verbose('Resetting active text', activeText);
|
|
@@ -366,7 +365,7 @@
|
|
|
366
365
|
|
|
367
366
|
update: {
|
|
368
367
|
text: function (text) {
|
|
369
|
-
|
|
368
|
+
const currentText = module.get.text();
|
|
370
369
|
if (text && text !== currentText) {
|
|
371
370
|
module.debug('Updating text', text);
|
|
372
371
|
if (settings.selector.text) {
|
|
@@ -482,7 +481,7 @@
|
|
|
482
481
|
query = query.split(/[ .]/);
|
|
483
482
|
maxDepth = query.length - 1;
|
|
484
483
|
$.each(query, function (depth, value) {
|
|
485
|
-
|
|
484
|
+
const camelCaseValue = depth !== maxDepth
|
|
486
485
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
487
486
|
: query;
|
|
488
487
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
: globalThis;
|
|
21
21
|
|
|
22
22
|
$.fn.visibility = function (...args) {
|
|
23
|
-
|
|
23
|
+
const $allModules = $(this);
|
|
24
24
|
|
|
25
25
|
let time = Date.now();
|
|
26
26
|
let performance = [];
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const parameters = args[0];
|
|
29
|
+
const methodInvoked = typeof parameters === 'string';
|
|
30
|
+
const queryArguments = args.slice(1);
|
|
31
|
+
const contextCheck = function (context, win) {
|
|
32
32
|
let $context;
|
|
33
33
|
if ([window, document].includes(context)) {
|
|
34
34
|
$context = $(context);
|
|
@@ -43,39 +43,38 @@
|
|
|
43
43
|
};
|
|
44
44
|
let returnedValue;
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
const moduleCount = $allModules.length;
|
|
47
47
|
let loadedCount = 0;
|
|
48
48
|
|
|
49
49
|
$allModules.each(function () {
|
|
50
|
-
|
|
50
|
+
const settings = $.isPlainObject(parameters)
|
|
51
51
|
? $.extend(true, {}, $.fn.visibility.settings, parameters)
|
|
52
52
|
: $.extend({}, $.fn.visibility.settings);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
const className = settings.className;
|
|
55
|
+
const namespace = settings.namespace;
|
|
56
|
+
const error = settings.error;
|
|
57
|
+
const metadata = settings.metadata;
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const eventNamespace = '.' + namespace;
|
|
60
|
+
const moduleNamespace = 'module-' + namespace;
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
const $window = $(window);
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
const $module = $(this);
|
|
65
|
+
const $context = contextCheck(settings.context, window);
|
|
66
66
|
|
|
67
67
|
let $placeholder;
|
|
68
68
|
|
|
69
69
|
let instance = $module.data(moduleNamespace);
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
const element = this;
|
|
72
72
|
let disabled = false;
|
|
73
73
|
|
|
74
74
|
let contextObserver;
|
|
75
75
|
let observer;
|
|
76
|
-
let module;
|
|
77
76
|
|
|
78
|
-
module = {
|
|
77
|
+
const module = {
|
|
79
78
|
|
|
80
79
|
initialize: function () {
|
|
81
80
|
module.debug('Initializing', settings);
|
|
@@ -223,9 +222,9 @@
|
|
|
223
222
|
}
|
|
224
223
|
let imagesLength = images.length;
|
|
225
224
|
let loadedCounter = 0;
|
|
226
|
-
|
|
225
|
+
const cache = [];
|
|
227
226
|
let cacheImage = document.createElement('img');
|
|
228
|
-
|
|
227
|
+
const handleLoad = function () {
|
|
229
228
|
loadedCounter++;
|
|
230
229
|
if (loadedCounter >= images.length && isFunction(callback)) {
|
|
231
230
|
callback();
|
|
@@ -272,7 +271,7 @@
|
|
|
272
271
|
};
|
|
273
272
|
},
|
|
274
273
|
image: function () {
|
|
275
|
-
|
|
274
|
+
const src = $module.data(metadata.src);
|
|
276
275
|
if (src) {
|
|
277
276
|
module.verbose('Lazy loading image', src);
|
|
278
277
|
settings.once = true;
|
|
@@ -383,12 +382,12 @@
|
|
|
383
382
|
|
|
384
383
|
is: {
|
|
385
384
|
onScreen: function () {
|
|
386
|
-
|
|
385
|
+
const calculations = module.get.elementCalculations();
|
|
387
386
|
|
|
388
387
|
return calculations.onScreen;
|
|
389
388
|
},
|
|
390
389
|
offScreen: function () {
|
|
391
|
-
|
|
390
|
+
const calculations = module.get.elementCalculations();
|
|
392
391
|
|
|
393
392
|
return calculations.offScreen;
|
|
394
393
|
},
|
|
@@ -400,14 +399,14 @@
|
|
|
400
399
|
return false;
|
|
401
400
|
},
|
|
402
401
|
verticallyScrollableContext: function () {
|
|
403
|
-
|
|
402
|
+
const overflowY = $context[0] !== window
|
|
404
403
|
? $context.css('overflow-y')
|
|
405
404
|
: false;
|
|
406
405
|
|
|
407
406
|
return overflowY === 'auto' || overflowY === 'scroll';
|
|
408
407
|
},
|
|
409
408
|
horizontallyScrollableContext: function () {
|
|
410
|
-
|
|
409
|
+
const overflowX = $context[0] !== window
|
|
411
410
|
? $context.css('overflow-x')
|
|
412
411
|
: false;
|
|
413
412
|
|
|
@@ -478,7 +477,7 @@
|
|
|
478
477
|
},
|
|
479
478
|
|
|
480
479
|
passed: function (amount, newCallback) {
|
|
481
|
-
|
|
480
|
+
const calculations = module.get.elementCalculations();
|
|
482
481
|
// assign callback
|
|
483
482
|
if (amount && newCallback) {
|
|
484
483
|
settings.onPassed[amount] = newCallback;
|
|
@@ -496,9 +495,9 @@
|
|
|
496
495
|
},
|
|
497
496
|
|
|
498
497
|
onScreen: function (newCallback) {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
498
|
+
const calculations = module.get.elementCalculations();
|
|
499
|
+
const callback = newCallback || settings.onOnScreen;
|
|
500
|
+
const callbackName = 'onScreen';
|
|
502
501
|
if (newCallback) {
|
|
503
502
|
module.debug('Adding callback for onScreen', newCallback);
|
|
504
503
|
settings.onOnScreen = newCallback;
|
|
@@ -514,9 +513,9 @@
|
|
|
514
513
|
},
|
|
515
514
|
|
|
516
515
|
offScreen: function (newCallback) {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
516
|
+
const calculations = module.get.elementCalculations();
|
|
517
|
+
const callback = newCallback || settings.onOffScreen;
|
|
518
|
+
const callbackName = 'offScreen';
|
|
520
519
|
if (newCallback) {
|
|
521
520
|
module.debug('Adding callback for offScreen', newCallback);
|
|
522
521
|
settings.onOffScreen = newCallback;
|
|
@@ -532,9 +531,9 @@
|
|
|
532
531
|
},
|
|
533
532
|
|
|
534
533
|
passing: function (newCallback) {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
534
|
+
const calculations = module.get.elementCalculations();
|
|
535
|
+
const callback = newCallback || settings.onPassing;
|
|
536
|
+
const callbackName = 'passing';
|
|
538
537
|
if (newCallback) {
|
|
539
538
|
module.debug('Adding callback for passing', newCallback);
|
|
540
539
|
settings.onPassing = newCallback;
|
|
@@ -550,9 +549,9 @@
|
|
|
550
549
|
},
|
|
551
550
|
|
|
552
551
|
topVisible: function (newCallback) {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
552
|
+
const calculations = module.get.elementCalculations();
|
|
553
|
+
const callback = newCallback || settings.onTopVisible;
|
|
554
|
+
const callbackName = 'topVisible';
|
|
556
555
|
if (newCallback) {
|
|
557
556
|
module.debug('Adding callback for top visible', newCallback);
|
|
558
557
|
settings.onTopVisible = newCallback;
|
|
@@ -568,9 +567,9 @@
|
|
|
568
567
|
},
|
|
569
568
|
|
|
570
569
|
bottomVisible: function (newCallback) {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
570
|
+
const calculations = module.get.elementCalculations();
|
|
571
|
+
const callback = newCallback || settings.onBottomVisible;
|
|
572
|
+
const callbackName = 'bottomVisible';
|
|
574
573
|
if (newCallback) {
|
|
575
574
|
module.debug('Adding callback for bottom visible', newCallback);
|
|
576
575
|
settings.onBottomVisible = newCallback;
|
|
@@ -586,9 +585,9 @@
|
|
|
586
585
|
},
|
|
587
586
|
|
|
588
587
|
topPassed: function (newCallback) {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
588
|
+
const calculations = module.get.elementCalculations();
|
|
589
|
+
const callback = newCallback || settings.onTopPassed;
|
|
590
|
+
const callbackName = 'topPassed';
|
|
592
591
|
if (newCallback) {
|
|
593
592
|
module.debug('Adding callback for top passed', newCallback);
|
|
594
593
|
settings.onTopPassed = newCallback;
|
|
@@ -604,9 +603,9 @@
|
|
|
604
603
|
},
|
|
605
604
|
|
|
606
605
|
bottomPassed: function (newCallback) {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
606
|
+
const calculations = module.get.elementCalculations();
|
|
607
|
+
const callback = newCallback || settings.onBottomPassed;
|
|
608
|
+
const callbackName = 'bottomPassed';
|
|
610
609
|
if (newCallback) {
|
|
611
610
|
module.debug('Adding callback for bottom passed', newCallback);
|
|
612
611
|
settings.onBottomPassed = newCallback;
|
|
@@ -622,9 +621,9 @@
|
|
|
622
621
|
},
|
|
623
622
|
|
|
624
623
|
passingReverse: function (newCallback) {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
624
|
+
const calculations = module.get.elementCalculations();
|
|
625
|
+
const callback = newCallback || settings.onPassingReverse;
|
|
626
|
+
const callbackName = 'passingReverse';
|
|
628
627
|
if (newCallback) {
|
|
629
628
|
module.debug('Adding callback for passing reverse', newCallback);
|
|
630
629
|
settings.onPassingReverse = newCallback;
|
|
@@ -642,9 +641,9 @@
|
|
|
642
641
|
},
|
|
643
642
|
|
|
644
643
|
topVisibleReverse: function (newCallback) {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
644
|
+
const calculations = module.get.elementCalculations();
|
|
645
|
+
const callback = newCallback || settings.onTopVisibleReverse;
|
|
646
|
+
const callbackName = 'topVisibleReverse';
|
|
648
647
|
if (newCallback) {
|
|
649
648
|
module.debug('Adding callback for top visible reverse', newCallback);
|
|
650
649
|
settings.onTopVisibleReverse = newCallback;
|
|
@@ -662,9 +661,9 @@
|
|
|
662
661
|
},
|
|
663
662
|
|
|
664
663
|
bottomVisibleReverse: function (newCallback) {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
664
|
+
const calculations = module.get.elementCalculations();
|
|
665
|
+
const callback = newCallback || settings.onBottomVisibleReverse;
|
|
666
|
+
const callbackName = 'bottomVisibleReverse';
|
|
668
667
|
if (newCallback) {
|
|
669
668
|
module.debug('Adding callback for bottom visible reverse', newCallback);
|
|
670
669
|
settings.onBottomVisibleReverse = newCallback;
|
|
@@ -682,9 +681,9 @@
|
|
|
682
681
|
},
|
|
683
682
|
|
|
684
683
|
topPassedReverse: function (newCallback) {
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
684
|
+
const calculations = module.get.elementCalculations();
|
|
685
|
+
const callback = newCallback || settings.onTopPassedReverse;
|
|
686
|
+
const callbackName = 'topPassedReverse';
|
|
688
687
|
if (newCallback) {
|
|
689
688
|
module.debug('Adding callback for top passed reverse', newCallback);
|
|
690
689
|
settings.onTopPassedReverse = newCallback;
|
|
@@ -702,9 +701,9 @@
|
|
|
702
701
|
},
|
|
703
702
|
|
|
704
703
|
bottomPassedReverse: function (newCallback) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
704
|
+
const calculations = module.get.elementCalculations();
|
|
705
|
+
const callback = newCallback || settings.onBottomPassedReverse;
|
|
706
|
+
const callbackName = 'bottomPassedReverse';
|
|
708
707
|
if (newCallback) {
|
|
709
708
|
module.debug('Adding callback for bottom passed reverse', newCallback);
|
|
710
709
|
settings.onBottomPassedReverse = newCallback;
|
|
@@ -722,9 +721,9 @@
|
|
|
722
721
|
},
|
|
723
722
|
|
|
724
723
|
execute: function (callback = false, callbackName = '') {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
if (callback) {
|
|
724
|
+
const calculations = module.get.elementCalculations();
|
|
725
|
+
const screen = module.get.screenCalculations();
|
|
726
|
+
if (isFunction(callback)) {
|
|
728
727
|
if (settings.continuous) {
|
|
729
728
|
module.debug('Callback being called continuously', callbackName, calculations);
|
|
730
729
|
callback.call(element, calculations, screen);
|
|
@@ -757,7 +756,7 @@
|
|
|
757
756
|
},
|
|
758
757
|
occurred: function (callback) {
|
|
759
758
|
if (callback) {
|
|
760
|
-
|
|
759
|
+
const occurred = module.cache.occurred;
|
|
761
760
|
if (occurred[callback] !== undefined && occurred[callback] === true) {
|
|
762
761
|
module.debug('Callback can now be called again', callback);
|
|
763
762
|
module.cache.occurred[callback] = false;
|
|
@@ -786,8 +785,8 @@
|
|
|
786
785
|
module.cache.scroll = scrollPosition;
|
|
787
786
|
},
|
|
788
787
|
direction: function () {
|
|
789
|
-
|
|
790
|
-
|
|
788
|
+
const scroll = module.get.scroll();
|
|
789
|
+
const lastScroll = module.get.lastScroll();
|
|
791
790
|
let direction;
|
|
792
791
|
if (scroll > lastScroll && lastScroll) {
|
|
793
792
|
direction = 'down';
|
|
@@ -801,8 +800,8 @@
|
|
|
801
800
|
return module.cache.direction;
|
|
802
801
|
},
|
|
803
802
|
elementPosition: function () {
|
|
804
|
-
|
|
805
|
-
|
|
803
|
+
const element = module.cache.element;
|
|
804
|
+
const screen = module.get.screenSize();
|
|
806
805
|
module.verbose('Saving element position');
|
|
807
806
|
// (quicker than $.extend)
|
|
808
807
|
element.fits = element.height < screen.height;
|
|
@@ -822,8 +821,8 @@
|
|
|
822
821
|
return element;
|
|
823
822
|
},
|
|
824
823
|
elementCalculations: function () {
|
|
825
|
-
|
|
826
|
-
|
|
824
|
+
const screen = module.get.screenCalculations();
|
|
825
|
+
const element = module.get.elementPosition();
|
|
827
826
|
// offset
|
|
828
827
|
if (settings.includeMargin) {
|
|
829
828
|
element.margin = {};
|
|
@@ -860,7 +859,7 @@
|
|
|
860
859
|
return element;
|
|
861
860
|
},
|
|
862
861
|
screenCalculations: function () {
|
|
863
|
-
|
|
862
|
+
const scroll = module.get.scroll();
|
|
864
863
|
module.save.direction();
|
|
865
864
|
module.cache.screen.top = scroll;
|
|
866
865
|
module.cache.screen.bottom = scroll + module.cache.screen.height;
|
|
@@ -881,7 +880,7 @@
|
|
|
881
880
|
|
|
882
881
|
get: {
|
|
883
882
|
pixelsPassed: function (amount) {
|
|
884
|
-
|
|
883
|
+
const element = module.get.elementCalculations();
|
|
885
884
|
if (amount.search('%') > -1) {
|
|
886
885
|
return element.height * (parseInt(amount, 10) / 100);
|
|
887
886
|
}
|
|
@@ -1038,7 +1037,7 @@
|
|
|
1038
1037
|
query = query.split(/[ .]/);
|
|
1039
1038
|
maxDepth = query.length - 1;
|
|
1040
1039
|
$.each(query, function (depth, value) {
|
|
1041
|
-
|
|
1040
|
+
const camelCaseValue = depth !== maxDepth
|
|
1042
1041
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
1043
1042
|
: query;
|
|
1044
1043
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
|
@@ -23,27 +23,26 @@
|
|
|
23
23
|
let time = Date.now();
|
|
24
24
|
let performance = [];
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const parameters = args[0];
|
|
27
|
+
const methodInvoked = typeof parameters === 'string';
|
|
28
|
+
const queryArguments = args.slice(1);
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
const settings = $.isPlainObject(parameters)
|
|
31
31
|
? $.extend(true, {}, $.site.settings, parameters)
|
|
32
32
|
: $.extend({}, $.site.settings);
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const namespace = settings.namespace;
|
|
35
|
+
const error = settings.error;
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
const moduleNamespace = 'module-' + namespace;
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const $document = $(document);
|
|
40
|
+
const $module = $document;
|
|
41
|
+
const element = this;
|
|
42
42
|
let instance = $module.data(moduleNamespace);
|
|
43
43
|
|
|
44
|
-
let module;
|
|
45
44
|
let returnedValue;
|
|
46
|
-
module = {
|
|
45
|
+
const module = {
|
|
47
46
|
|
|
48
47
|
initialize: function () {
|
|
49
48
|
module.instantiate();
|
|
@@ -75,7 +74,7 @@
|
|
|
75
74
|
|
|
76
75
|
enabled: {
|
|
77
76
|
modules: function (modules = settings.modules) {
|
|
78
|
-
|
|
77
|
+
const enabledModules = [];
|
|
79
78
|
$.each(modules, function (index, name) {
|
|
80
79
|
if (module.moduleExists(name)) {
|
|
81
80
|
enabledModules.push(name);
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
|
|
89
88
|
disabled: {
|
|
90
89
|
modules: function (modules = settings.modules) {
|
|
91
|
-
|
|
90
|
+
const disabledModules = [];
|
|
92
91
|
$.each(modules, function (index, name) {
|
|
93
92
|
if (!module.moduleExists(name)) {
|
|
94
93
|
disabledModules.push(name);
|
|
@@ -107,7 +106,7 @@
|
|
|
107
106
|
: [modules])
|
|
108
107
|
: modules || settings.modules;
|
|
109
108
|
$.each(modules, function (index, name) {
|
|
110
|
-
|
|
109
|
+
const namespace = module.moduleExists(name)
|
|
111
110
|
? $.fn[name].settings.namespace || false
|
|
112
111
|
: true;
|
|
113
112
|
let $existingModules;
|
|
@@ -296,7 +295,7 @@
|
|
|
296
295
|
query = query.split(/[ .]/);
|
|
297
296
|
maxDepth = query.length - 1;
|
|
298
297
|
$.each(query, function (depth, value) {
|
|
299
|
-
|
|
298
|
+
const camelCaseValue = depth !== maxDepth
|
|
300
299
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
301
300
|
: query;
|
|
302
301
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|