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
|
|
@@ -31,7 +31,7 @@
|
|
31
31
|
performance = [],
|
32
32
|
|
33
33
|
query = arguments[0],
|
34
|
-
methodInvoked =
|
34
|
+
methodInvoked = typeof query === 'string',
|
35
35
|
queryArguments = [].slice.call(arguments, 1),
|
36
36
|
|
37
37
|
alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
|
@@ -51,7 +51,7 @@
|
|
51
51
|
|
52
52
|
$allModules.each(function () {
|
53
53
|
var
|
54
|
-
settings =
|
54
|
+
settings = $.isPlainObject(parameters)
|
55
55
|
? $.extend(true, {}, $.fn.slider.settings, parameters)
|
56
56
|
: $.extend({}, $.fn.slider.settings),
|
57
57
|
|
@@ -186,7 +186,9 @@
|
|
186
186
|
attrValue = $child.attr('data-value')
|
187
187
|
;
|
188
188
|
if (attrValue) {
|
189
|
-
attrValue = attrValue > max
|
189
|
+
attrValue = attrValue > max
|
190
|
+
? max
|
191
|
+
: (attrValue < min ? min : attrValue);
|
190
192
|
ratio = (attrValue - min) / (max - min);
|
191
193
|
} else {
|
192
194
|
ratio = (index + 1) / (numChildren + 1);
|
@@ -204,10 +206,10 @@
|
|
204
206
|
for (var i = 0, len = module.get.numLabels(); i <= len; i++) {
|
205
207
|
var
|
206
208
|
labelText = module.get.label(i),
|
207
|
-
$label =
|
208
|
-
? !(i % module.get.gapRatio())
|
209
|
+
$label = labelText !== ''
|
210
|
+
? (!(i % module.get.gapRatio())
|
209
211
|
? $('<li class="label">' + labelText + '</li>')
|
210
|
-
: $('<li class="halftick label"></li>')
|
212
|
+
: $('<li class="halftick label"></li>'))
|
211
213
|
: null,
|
212
214
|
ratio = i / len
|
213
215
|
;
|
@@ -335,7 +337,7 @@
|
|
335
337
|
}
|
336
338
|
},
|
337
339
|
move: function (event) {
|
338
|
-
if (event.type
|
340
|
+
if (event.type === 'mousemove') {
|
339
341
|
event.preventDefault(); // prevent text selection etc.
|
340
342
|
}
|
341
343
|
if (module.is.disabled()) {
|
@@ -343,14 +345,14 @@
|
|
343
345
|
return;
|
344
346
|
}
|
345
347
|
var value = module.determine.valueFromEvent(event);
|
346
|
-
if (event.type
|
348
|
+
if (event.type === 'mousemove' && $currThumb === undefined) {
|
347
349
|
var
|
348
350
|
eventPos = module.determine.eventPos(event),
|
349
351
|
newPos = module.determine.pos(eventPos)
|
350
352
|
;
|
351
353
|
$currThumb = initialPosition > newPos ? $thumb : $secondThumb;
|
352
354
|
}
|
353
|
-
if (module.get.step()
|
355
|
+
if (module.get.step() === 0 || module.is.smooth()) {
|
354
356
|
var
|
355
357
|
thumbVal = module.thumbVal,
|
356
358
|
secondThumbVal = module.secondThumbVal,
|
@@ -409,31 +411,35 @@
|
|
409
411
|
}
|
410
412
|
if (first || module.is.focused()) {
|
411
413
|
var step = module.determine.keyMovement(event);
|
412
|
-
if (step
|
414
|
+
if (step !== NO_STEP) {
|
413
415
|
event.preventDefault();
|
414
416
|
switch (step) {
|
415
|
-
case SINGLE_STEP:
|
417
|
+
case SINGLE_STEP: {
|
416
418
|
module.takeStep();
|
417
419
|
|
418
420
|
break;
|
419
|
-
|
421
|
+
}
|
422
|
+
case BIG_STEP: {
|
420
423
|
module.takeStep(module.get.multiplier());
|
421
424
|
|
422
425
|
break;
|
423
|
-
|
426
|
+
}
|
427
|
+
case SINGLE_BACKSTEP: {
|
424
428
|
module.backStep();
|
425
429
|
|
426
430
|
break;
|
427
|
-
|
431
|
+
}
|
432
|
+
case BIG_BACKSTEP: {
|
428
433
|
module.backStep(module.get.multiplier());
|
429
434
|
|
430
435
|
break;
|
436
|
+
}
|
431
437
|
}
|
432
438
|
}
|
433
439
|
}
|
434
440
|
},
|
435
441
|
activateFocus: function (event) {
|
436
|
-
if (!module.is.focused() && module.is.hover() && module.determine.keyMovement(event)
|
442
|
+
if (!module.is.focused() && module.is.hover() && module.determine.keyMovement(event) !== NO_STEP) {
|
437
443
|
event.preventDefault();
|
438
444
|
module.event.keydown(event, true);
|
439
445
|
$module.trigger('focus');
|
@@ -441,7 +447,7 @@
|
|
441
447
|
},
|
442
448
|
resize: function (_event) {
|
443
449
|
// To avoid a useless performance cost, we only call the label refresh when its necessary
|
444
|
-
if (gapRatio
|
450
|
+
if (gapRatio !== module.get.gapRatio()) {
|
445
451
|
module.setup.labels();
|
446
452
|
gapRatio = module.get.gapRatio();
|
447
453
|
}
|
@@ -457,7 +463,9 @@
|
|
457
463
|
module.setup.labels();
|
458
464
|
},
|
459
465
|
takeStep: function (multiplier) {
|
460
|
-
|
466
|
+
if (!multiplier) {
|
467
|
+
multiplier = 1;
|
468
|
+
}
|
461
469
|
var
|
462
470
|
step = module.get.step(),
|
463
471
|
currValue = module.get.currentThumbValue()
|
@@ -465,7 +473,7 @@
|
|
465
473
|
module.verbose('Taking a step');
|
466
474
|
if (step > 0) {
|
467
475
|
module.set.value(currValue + step * multiplier);
|
468
|
-
} else if (step
|
476
|
+
} else if (step === 0) {
|
469
477
|
var
|
470
478
|
precision = module.get.precision(),
|
471
479
|
newValue = currValue + (multiplier / precision)
|
@@ -475,7 +483,9 @@
|
|
475
483
|
},
|
476
484
|
|
477
485
|
backStep: function (multiplier) {
|
478
|
-
|
486
|
+
if (!multiplier) {
|
487
|
+
multiplier = 1;
|
488
|
+
}
|
479
489
|
var
|
480
490
|
step = module.get.step(),
|
481
491
|
currValue = module.get.currentThumbValue()
|
@@ -483,7 +493,7 @@
|
|
483
493
|
module.verbose('Going back a step');
|
484
494
|
if (step > 0) {
|
485
495
|
module.set.value(currValue - step * multiplier);
|
486
|
-
} else if (step
|
496
|
+
} else if (step === 0) {
|
487
497
|
var
|
488
498
|
precision = module.get.precision(),
|
489
499
|
newValue = currValue - (multiplier / precision)
|
@@ -572,9 +582,9 @@
|
|
572
582
|
decimalPlaces,
|
573
583
|
step = module.get.step()
|
574
584
|
;
|
575
|
-
if (step
|
585
|
+
if (step !== 0) {
|
576
586
|
var split = String(step).split('.');
|
577
|
-
decimalPlaces = split.length
|
587
|
+
decimalPlaces = split.length === 2 ? split[1].length : 0;
|
578
588
|
} else {
|
579
589
|
decimalPlaces = settings.decimalPlaces;
|
580
590
|
}
|
@@ -614,12 +624,15 @@
|
|
614
624
|
}
|
615
625
|
|
616
626
|
switch (settings.labelType) {
|
617
|
-
case settings.labelTypes.number:
|
627
|
+
case settings.labelTypes.number: {
|
618
628
|
return Math.round(((value * (module.get.step() === 0 ? 1 : module.get.step())) + module.get.min()) * precision) / precision;
|
619
|
-
|
620
|
-
|
621
|
-
|
629
|
+
}
|
630
|
+
case settings.labelTypes.letter: {
|
631
|
+
return alphabet[value % 26];
|
632
|
+
}
|
633
|
+
default: {
|
622
634
|
return value;
|
635
|
+
}
|
623
636
|
}
|
624
637
|
},
|
625
638
|
value: function () {
|
@@ -630,7 +643,7 @@
|
|
630
643
|
},
|
631
644
|
thumbValue: function (which) {
|
632
645
|
switch (which) {
|
633
|
-
case 'second':
|
646
|
+
case 'second': {
|
634
647
|
if (module.is.range()) {
|
635
648
|
return module.secondThumbVal;
|
636
649
|
}
|
@@ -638,9 +651,10 @@
|
|
638
651
|
module.error(error.notrange);
|
639
652
|
|
640
653
|
break;
|
641
|
-
|
642
|
-
default:
|
654
|
+
}
|
655
|
+
default: {
|
643
656
|
return module.thumbVal;
|
657
|
+
}
|
644
658
|
}
|
645
659
|
},
|
646
660
|
multiplier: function () {
|
@@ -648,7 +662,7 @@
|
|
648
662
|
},
|
649
663
|
thumbPosition: function (which) {
|
650
664
|
switch (which) {
|
651
|
-
case 'second':
|
665
|
+
case 'second': {
|
652
666
|
if (module.is.range()) {
|
653
667
|
return secondPos;
|
654
668
|
}
|
@@ -656,9 +670,10 @@
|
|
656
670
|
module.error(error.notrange);
|
657
671
|
|
658
672
|
break;
|
659
|
-
|
660
|
-
default:
|
673
|
+
}
|
674
|
+
default: {
|
661
675
|
return position;
|
676
|
+
}
|
662
677
|
}
|
663
678
|
},
|
664
679
|
gapRatio: function () {
|
@@ -720,8 +735,8 @@
|
|
720
735
|
thumbPos: function ($element) {
|
721
736
|
var
|
722
737
|
pos = module.is.vertical()
|
723
|
-
? module.is.reversed() ? $element.css('bottom') : $element.css('top')
|
724
|
-
: module.is.reversed() ? $element.css('right') : $element.css('left')
|
738
|
+
? (module.is.reversed() ? $element.css('bottom') : $element.css('top'))
|
739
|
+
: (module.is.reversed() ? $element.css('right') : $element.css('left'))
|
725
740
|
;
|
726
741
|
|
727
742
|
return pos;
|
@@ -730,7 +745,9 @@
|
|
730
745
|
var
|
731
746
|
min = module.get.min(),
|
732
747
|
max = module.get.max(),
|
733
|
-
value = val > max
|
748
|
+
value = val > max
|
749
|
+
? max
|
750
|
+
: (val < min ? min : val),
|
734
751
|
trackLength = module.get.trackLength(),
|
735
752
|
ratio = (value - min) / (max - min),
|
736
753
|
position = Math.round(ratio * trackLength)
|
@@ -744,7 +761,7 @@
|
|
744
761
|
trackLength = module.get.trackLength(),
|
745
762
|
step = module.get.step(),
|
746
763
|
position = Math.round(ratio * trackLength),
|
747
|
-
adjustedPos =
|
764
|
+
adjustedPos = step === 0 ? position : Math.round(position / step) * step
|
748
765
|
;
|
749
766
|
|
750
767
|
return adjustedPos;
|
@@ -775,7 +792,9 @@
|
|
775
792
|
ratio,
|
776
793
|
value
|
777
794
|
;
|
778
|
-
newPos = newPos < 0
|
795
|
+
newPos = newPos < 0
|
796
|
+
? 0
|
797
|
+
: (newPos > trackLength ? trackLength : newPos);
|
779
798
|
ratio = newPos / trackLength;
|
780
799
|
if (module.is.reversed()) {
|
781
800
|
ratio = 1 - ratio;
|
@@ -817,11 +836,11 @@
|
|
817
836
|
ratio = (position - startPos) / (endPos - startPos),
|
818
837
|
range = module.get.max() - module.get.min(),
|
819
838
|
step = module.get.step(),
|
820
|
-
value =
|
821
|
-
difference =
|
839
|
+
value = ratio * range,
|
840
|
+
difference = step === 0 ? value : Math.round(value / step) * step
|
822
841
|
;
|
823
842
|
module.verbose('Determined value based upon position: ' + position + ' as: ' + value);
|
824
|
-
if (value
|
843
|
+
if (value !== difference) {
|
825
844
|
module.verbose('Rounding value to closest step: ' + difference);
|
826
845
|
}
|
827
846
|
// Use precision to avoid ugly Javascript floating point rounding issues
|
@@ -834,28 +853,28 @@
|
|
834
853
|
var
|
835
854
|
key = event.which,
|
836
855
|
downArrow = module.is.vertical()
|
837
|
-
? module.is.reversed() ? keys.downArrow : keys.upArrow
|
856
|
+
? (module.is.reversed() ? keys.downArrow : keys.upArrow)
|
838
857
|
: keys.downArrow,
|
839
858
|
upArrow = module.is.vertical()
|
840
|
-
? module.is.reversed() ? keys.upArrow : keys.downArrow
|
859
|
+
? (module.is.reversed() ? keys.upArrow : keys.downArrow)
|
841
860
|
: keys.upArrow,
|
842
861
|
leftArrow = !module.is.vertical()
|
843
|
-
? module.is.reversed() ? keys.rightArrow : keys.leftArrow
|
862
|
+
? (module.is.reversed() ? keys.rightArrow : keys.leftArrow)
|
844
863
|
: keys.leftArrow,
|
845
864
|
rightArrow = !module.is.vertical()
|
846
|
-
? module.is.reversed() ? keys.leftArrow : keys.rightArrow
|
865
|
+
? (module.is.reversed() ? keys.leftArrow : keys.rightArrow)
|
847
866
|
: keys.rightArrow
|
848
867
|
;
|
849
|
-
if (key
|
868
|
+
if (key === downArrow || key === leftArrow) {
|
850
869
|
return SINGLE_BACKSTEP;
|
851
870
|
}
|
852
|
-
if (key
|
871
|
+
if (key === upArrow || key === rightArrow) {
|
853
872
|
return SINGLE_STEP;
|
854
873
|
}
|
855
|
-
if (key
|
874
|
+
if (key === keys.pageDown) {
|
856
875
|
return BIG_BACKSTEP;
|
857
876
|
}
|
858
|
-
if (key
|
877
|
+
if (key === keys.pageUp) {
|
859
878
|
return BIG_STEP;
|
860
879
|
}
|
861
880
|
|
@@ -987,7 +1006,7 @@
|
|
987
1006
|
position: function (newValue, $element) {
|
988
1007
|
var
|
989
1008
|
newPos = module.handleNewValuePosition(newValue),
|
990
|
-
$targetThumb = $element
|
1009
|
+
$targetThumb = $element || $currThumb,
|
991
1010
|
thumbVal = module.thumbVal || module.get.min(),
|
992
1011
|
secondThumbVal = module.secondThumbVal || module.get.min()
|
993
1012
|
;
|
@@ -1038,9 +1057,11 @@
|
|
1038
1057
|
startMargin = module.get.trackStartMargin(),
|
1039
1058
|
endMargin = module.get.trackEndMargin(),
|
1040
1059
|
posDir = module.is.vertical()
|
1041
|
-
? module.is.reversed() ? 'bottom' : 'top'
|
1042
|
-
: module.is.reversed() ? 'right' : 'left',
|
1043
|
-
startMarginMod = module.is.reversed() && !module.is.vertical()
|
1060
|
+
? (module.is.reversed() ? 'bottom' : 'top')
|
1061
|
+
: (module.is.reversed() ? 'right' : 'left'),
|
1062
|
+
startMarginMod = module.is.reversed() && !module.is.vertical()
|
1063
|
+
? ' - '
|
1064
|
+
: ' + '
|
1044
1065
|
;
|
1045
1066
|
var position = '(100% - ' + startMargin + ' - ' + endMargin + ') * ' + ratio;
|
1046
1067
|
$label.css(posDir, 'calc(' + position + startMarginMod + startMargin + ')');
|
@@ -1201,17 +1222,17 @@
|
|
1201
1222
|
query = query.split(/[ .]/);
|
1202
1223
|
maxDepth = query.length - 1;
|
1203
1224
|
$.each(query, function (depth, value) {
|
1204
|
-
var camelCaseValue =
|
1225
|
+
var camelCaseValue = depth !== maxDepth
|
1205
1226
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
1206
1227
|
: query
|
1207
1228
|
;
|
1208
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
1229
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
1209
1230
|
object = object[camelCaseValue];
|
1210
1231
|
} else if (object[camelCaseValue] !== undefined) {
|
1211
1232
|
found = object[camelCaseValue];
|
1212
1233
|
|
1213
1234
|
return false;
|
1214
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
1235
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
1215
1236
|
object = object[value];
|
1216
1237
|
} else if (object[value] !== undefined) {
|
1217
1238
|
found = object[value];
|
@@ -1254,7 +1275,7 @@
|
|
1254
1275
|
}
|
1255
1276
|
});
|
1256
1277
|
|
1257
|
-
return
|
1278
|
+
return returnedValue !== undefined
|
1258
1279
|
? returnedValue
|
1259
1280
|
: this;
|
1260
1281
|
};
|
@@ -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
|
returnedValue
|
35
35
|
;
|
36
36
|
|
37
37
|
$allModules.each(function () {
|
38
38
|
var
|
39
|
-
settings =
|
39
|
+
settings = $.isPlainObject(parameters)
|
40
40
|
? $.extend(true, {}, $.fn.sticky.settings, parameters)
|
41
41
|
: $.extend({}, $.fn.sticky.settings),
|
42
42
|
|
@@ -190,7 +190,7 @@
|
|
190
190
|
[].forEach.call(mutations, function (mutation) {
|
191
191
|
if (mutation.removedNodes) {
|
192
192
|
[].forEach.call(mutation.removedNodes, function (node) {
|
193
|
-
if (node
|
193
|
+
if (node === element || $(node).find(element).length > 0) {
|
194
194
|
module.debug('Element removed from DOM, tearing down events');
|
195
195
|
module.destroy();
|
196
196
|
}
|
@@ -237,7 +237,7 @@
|
|
237
237
|
;
|
238
238
|
$element.addClass(className.supported);
|
239
239
|
|
240
|
-
return
|
240
|
+
return $element.css('position').match('sticky');
|
241
241
|
},
|
242
242
|
},
|
243
243
|
|
@@ -279,8 +279,8 @@
|
|
279
279
|
context.offset.left += scrollContext.left;
|
280
280
|
}
|
281
281
|
module.cache = {
|
282
|
-
fits: (
|
283
|
-
sameHeight:
|
282
|
+
fits: (element.height + settings.offset) <= scrollContext.height,
|
283
|
+
sameHeight: element.height === context.height,
|
284
284
|
scrollContext: {
|
285
285
|
height: scrollContext.height,
|
286
286
|
},
|
@@ -320,8 +320,8 @@
|
|
320
320
|
scrollChange: function (scroll) {
|
321
321
|
scroll = scroll || $scroll.scrollTop();
|
322
322
|
|
323
|
-
return
|
324
|
-
?
|
323
|
+
return module.lastScroll
|
324
|
+
? scroll - module.lastScroll
|
325
325
|
: 0;
|
326
326
|
},
|
327
327
|
currentElementScroll: function () {
|
@@ -329,7 +329,7 @@
|
|
329
329
|
return module.elementScroll;
|
330
330
|
}
|
331
331
|
|
332
|
-
return
|
332
|
+
return module.is.top()
|
333
333
|
? Math.abs(parseInt($module.css('top'), 10)) || 0
|
334
334
|
: Math.abs(parseInt($module.css('bottom'), 10)) || 0;
|
335
335
|
},
|
@@ -340,9 +340,9 @@
|
|
340
340
|
element = module.cache.element,
|
341
341
|
scrollContext = module.cache.scrollContext,
|
342
342
|
delta = module.get.scrollChange(scroll),
|
343
|
-
maxScroll =
|
343
|
+
maxScroll = element.height - scrollContext.height + settings.offset,
|
344
344
|
elementScroll = module.get.currentElementScroll(),
|
345
|
-
possibleScroll =
|
345
|
+
possibleScroll = elementScroll + delta
|
346
346
|
;
|
347
347
|
if (module.cache.fits || possibleScroll < 0) {
|
348
348
|
elementScroll = 0;
|
@@ -418,13 +418,13 @@
|
|
418
418
|
},
|
419
419
|
scroll: function (scroll) {
|
420
420
|
module.debug('Setting scroll on element', scroll);
|
421
|
-
if (module.elementScroll
|
421
|
+
if (module.elementScroll === scroll) {
|
422
422
|
return;
|
423
423
|
}
|
424
424
|
if (module.is.top()) {
|
425
425
|
$module
|
426
426
|
.css('bottom', '')
|
427
|
-
.css('top',
|
427
|
+
.css('top', -scroll + 'px')
|
428
428
|
;
|
429
429
|
}
|
430
430
|
if (module.is.bottom()) {
|
@@ -444,7 +444,7 @@
|
|
444
444
|
|
445
445
|
is: {
|
446
446
|
standardScroll: function () {
|
447
|
-
return
|
447
|
+
return $scroll[0] === window;
|
448
448
|
},
|
449
449
|
top: function () {
|
450
450
|
return $module.hasClass(className.top);
|
@@ -453,10 +453,10 @@
|
|
453
453
|
return $module.hasClass(className.bottom);
|
454
454
|
},
|
455
455
|
initialPosition: function () {
|
456
|
-
return
|
456
|
+
return !module.is.fixed() && !module.is.bound();
|
457
457
|
},
|
458
458
|
hidden: function () {
|
459
|
-
return
|
459
|
+
return !$module.is(':visible');
|
460
460
|
},
|
461
461
|
bound: function () {
|
462
462
|
return $module.hasClass(className.bound);
|
@@ -475,20 +475,20 @@
|
|
475
475
|
element = cache.element,
|
476
476
|
scrollContext = cache.scrollContext,
|
477
477
|
context = cache.context,
|
478
|
-
offset =
|
478
|
+
offset = module.is.bottom() && settings.pushing
|
479
479
|
? settings.bottomOffset
|
480
480
|
: settings.offset,
|
481
481
|
scroll = {
|
482
482
|
top: cachedPosition + offset,
|
483
483
|
bottom: cachedPosition + offset + scrollContext.height,
|
484
484
|
},
|
485
|
-
elementScroll =
|
485
|
+
elementScroll = fits
|
486
486
|
? 0
|
487
487
|
: module.get.elementScroll(scroll.top),
|
488
488
|
|
489
489
|
// shorthand
|
490
490
|
doesntFit = !fits,
|
491
|
-
elementVisible =
|
491
|
+
elementVisible = element.height !== 0
|
492
492
|
;
|
493
493
|
if (elementVisible && !sameHeight) {
|
494
494
|
if (module.is.initialPosition()) {
|
@@ -795,17 +795,17 @@
|
|
795
795
|
query = query.split(/[ .]/);
|
796
796
|
maxDepth = query.length - 1;
|
797
797
|
$.each(query, function (depth, value) {
|
798
|
-
var camelCaseValue =
|
798
|
+
var camelCaseValue = depth !== maxDepth
|
799
799
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
800
800
|
: query
|
801
801
|
;
|
802
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
802
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
803
803
|
object = object[camelCaseValue];
|
804
804
|
} else if (object[camelCaseValue] !== undefined) {
|
805
805
|
found = object[camelCaseValue];
|
806
806
|
|
807
807
|
return false;
|
808
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
808
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
809
809
|
object = object[value];
|
810
810
|
} else if (object[value] !== undefined) {
|
811
811
|
found = object[value];
|
@@ -846,7 +846,7 @@
|
|
846
846
|
}
|
847
847
|
});
|
848
848
|
|
849
|
-
return
|
849
|
+
return returnedValue !== undefined
|
850
850
|
? returnedValue
|
851
851
|
: this;
|
852
852
|
};
|