fomantic-ui 2.9.1-beta.22 → 2.9.1-beta.24
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/index.js +23 -0
- package/.eslint/no-extra-parens-rule.js +17 -0
- package/.eslint/package.json +11 -0
- package/.eslintrc.js +13 -70
- package/.stylelintrc.js +5 -7
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +26 -26
- 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 +95 -94
- 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 +3 -3
- package/dist/components/calendar.js +181 -151
- package/dist/components/calendar.min.css +2 -2
- 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 +14 -14
- 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 +23 -25
- 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 +252 -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 +27 -33
- 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 +2 -2
- package/dist/components/flyout.js +50 -44
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +2 -2
- package/dist/components/form.js +187 -163
- package/dist/components/form.min.css +2 -2
- 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 +49 -45
- 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 +22 -20
- 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 +71 -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 +46 -46
- 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 +15 -15
- 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 +69 -74
- 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 +39 -39
- 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 +39 -37
- 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 +22 -21
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +69 -64
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +15 -15
- 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 +55 -57
- 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 +57 -30
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +7 -7
- package/dist/components/transition.js +45 -39
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +25 -25
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +60 -60
- package/dist/semantic.js +1518 -1427
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/responsive.html +1 -1
- package/gulpfile.js +1 -1
- package/package.json +2 -1
- package/scripts/nightly-version.js +6 -4
- package/src/definitions/behaviors/api.js +94 -93
- package/src/definitions/behaviors/form.js +186 -162
- package/src/definitions/behaviors/state.js +14 -14
- package/src/definitions/behaviors/visibility.js +24 -24
- package/src/definitions/collections/menu.less +2 -2
- package/src/definitions/elements/button.less +2 -2
- package/src/definitions/elements/loader.less +4 -4
- package/src/definitions/elements/step.less +1 -1
- package/src/definitions/globals/site.js +21 -20
- package/src/definitions/modules/accordion.js +25 -25
- package/src/definitions/modules/calendar.js +180 -150
- package/src/definitions/modules/calendar.less +2 -2
- package/src/definitions/modules/checkbox.js +13 -13
- package/src/definitions/modules/dimmer.js +22 -24
- package/src/definitions/modules/dimmer.less +10 -10
- package/src/definitions/modules/dropdown.js +251 -253
- package/src/definitions/modules/embed.js +26 -32
- package/src/definitions/modules/flyout.js +49 -43
- package/src/definitions/modules/flyout.less +1 -1
- package/src/definitions/modules/modal.js +48 -44
- package/src/definitions/modules/nag.js +21 -19
- package/src/definitions/modules/popup.js +70 -70
- package/src/definitions/modules/progress.js +45 -45
- package/src/definitions/modules/rating.js +14 -14
- package/src/definitions/modules/search.js +68 -73
- package/src/definitions/modules/shape.js +38 -38
- package/src/definitions/modules/sidebar.js +38 -36
- package/src/definitions/modules/slider.js +68 -63
- package/src/definitions/modules/sticky.js +24 -24
- package/src/definitions/modules/tab.js +54 -56
- package/src/definitions/modules/toast.js +56 -29
- package/src/definitions/modules/transition.js +44 -38
- package/src/themes/amazon/elements/button.overrides +7 -7
- package/src/themes/default/collections/form.variables +1 -1
- package/src/themes/default/elements/reveal.variables +1 -1
- package/src/themes/default/globals/site.variables +1 -1
- package/src/themes/default/modules/dimmer.variables +6 -6
- package/src/themes/default/modules/modal.variables +1 -1
- package/src/themes/default/modules/slider.variables +4 -4
- package/src/themes/default/modules/toast.variables +2 -2
- package/src/themes/default/modules/transition.overrides +12 -12
- package/src/themes/flat/collections/form.overrides +2 -2
- package/src/themes/flat/globals/site.variables +1 -1
- package/src/themes/github/collections/form.overrides +2 -2
- package/src/themes/github/collections/menu.variables +1 -1
- package/src/themes/github/collections/message.overrides +3 -3
- package/src/themes/github/elements/input.overrides +2 -2
- package/src/themes/timeline/views/feed.overrides +3 -3
- package/src/themes/twitter/elements/button.overrides +2 -2
- package/tasks/README.md +1 -3
- package/tasks/admin/components/create.js +9 -16
- package/tasks/admin/components/init.js +7 -7
- package/tasks/admin/components/update.js +10 -10
- package/tasks/admin/distributions/create.js +16 -18
- package/tasks/admin/distributions/init.js +7 -7
- package/tasks/admin/distributions/update.js +10 -10
- package/tasks/admin/publish.js +1 -3
- package/tasks/admin/register.js +6 -6
- package/tasks/admin/release.js +1 -3
- package/tasks/build/assets.js +2 -2
- package/tasks/build/css.js +8 -3
- package/tasks/build/javascript.js +3 -1
- package/tasks/build.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/README.md +3 -5
- package/tasks/collections/admin.js +1 -1
- package/tasks/collections/docs.js +1 -1
- package/tasks/collections/install.js +1 -1
- package/tasks/collections/rtl.js +1 -1
- package/tasks/collections/various.js +1 -1
- package/tasks/config/admin/github.js +6 -8
- package/tasks/config/admin/templates/css-package.js +1 -1
- package/tasks/config/admin/templates/less-package.js +1 -1
- package/tasks/config/npm/gulpfile.js +7 -7
- package/tasks/config/project/config.js +14 -19
- package/tasks/config/project/install.js +35 -34
- package/tasks/config/project/release.js +15 -16
- package/tasks/config/tasks.js +18 -20
- package/tasks/config/user.js +5 -3
- package/tasks/docs/build.js +5 -3
- package/tasks/docs/metadata.js +7 -8
- package/tasks/docs/serve.js +6 -3
- package/tasks/install.js +39 -39
- 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/.eslintrc.js +0 -4
- package/test/meteor/assets.js +1 -1
- package/test/modules/module.spec.js +15 -15
- package/test/modules/popup.spec.js +1 -1
- package/test/modules/search.spec.js +1 -1
- package/test/modules/tab.spec.js +1 -1
- package/test/modules/transition.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
|
|
@@ -30,11 +30,11 @@
|
|
30
30
|
|
31
31
|
moduleSelector = $allModules.selector || '',
|
32
32
|
|
33
|
-
time =
|
33
|
+
time = Date.now(),
|
34
34
|
performance = [],
|
35
35
|
|
36
36
|
query = arguments[0],
|
37
|
-
methodInvoked =
|
37
|
+
methodInvoked = typeof query === 'string',
|
38
38
|
queryArguments = [].slice.call(arguments, 1),
|
39
39
|
|
40
40
|
requestAnimationFrame = window.requestAnimationFrame
|
@@ -49,7 +49,7 @@
|
|
49
49
|
|
50
50
|
$allModules.each(function () {
|
51
51
|
var
|
52
|
-
settings =
|
52
|
+
settings = $.isPlainObject(parameters)
|
53
53
|
? $.extend(true, {}, $.fn.sidebar.settings, parameters)
|
54
54
|
: $.extend({}, $.fn.sidebar.settings),
|
55
55
|
|
@@ -143,8 +143,8 @@
|
|
143
143
|
clickaway: function (event) {
|
144
144
|
if (settings.closable) {
|
145
145
|
var
|
146
|
-
clickedInPusher =
|
147
|
-
clickedContext =
|
146
|
+
clickedInPusher = $pusher.find(event.target).length > 0 || $pusher.is(event.target),
|
147
|
+
clickedContext = $context.is(event.target)
|
148
148
|
;
|
149
149
|
if (clickedInPusher) {
|
150
150
|
module.verbose('User clicked on dimmed page');
|
@@ -309,7 +309,7 @@
|
|
309
309
|
module.verbose('Forcing repaint event');
|
310
310
|
element.style.display = 'none';
|
311
311
|
var ignored = element.offsetHeight;
|
312
|
-
element.scrollTop = element.scrollTop;
|
312
|
+
element.scrollTop = element.scrollTop; // eslint-disable-line no-self-assign
|
313
313
|
element.style.display = '';
|
314
314
|
},
|
315
315
|
|
@@ -374,7 +374,7 @@
|
|
374
374
|
bodyMargin: function () {
|
375
375
|
initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
|
376
376
|
var
|
377
|
-
bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, '')),
|
377
|
+
bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10),
|
378
378
|
bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth
|
379
379
|
;
|
380
380
|
tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
|
@@ -403,9 +403,9 @@
|
|
403
403
|
module.hideOthers(module.show);
|
404
404
|
|
405
405
|
return;
|
406
|
-
} else {
|
407
|
-
module.hideOthers();
|
408
406
|
}
|
407
|
+
|
408
|
+
module.hideOthers();
|
409
409
|
} else {
|
410
410
|
settings.transition = 'overlay';
|
411
411
|
}
|
@@ -437,13 +437,13 @@
|
|
437
437
|
},
|
438
438
|
|
439
439
|
othersAnimating: function () {
|
440
|
-
return
|
440
|
+
return $sidebars.not($module).filter('.' + className.animating).length > 0;
|
441
441
|
},
|
442
442
|
othersVisible: function () {
|
443
|
-
return
|
443
|
+
return $sidebars.not($module).filter('.' + className.visible).length > 0;
|
444
444
|
},
|
445
445
|
othersActive: function () {
|
446
|
-
return
|
446
|
+
return module.othersVisible() || module.othersAnimating();
|
447
447
|
},
|
448
448
|
|
449
449
|
hideOthers: function (callback) {
|
@@ -475,7 +475,7 @@
|
|
475
475
|
pushPage: function (callback) {
|
476
476
|
var
|
477
477
|
transition = module.get.transition(),
|
478
|
-
$transition =
|
478
|
+
$transition = transition === 'overlay' || module.othersActive()
|
479
479
|
? $module
|
480
480
|
: $pusher,
|
481
481
|
animate,
|
@@ -521,7 +521,7 @@
|
|
521
521
|
pullPage: function (callback) {
|
522
522
|
var
|
523
523
|
transition = module.get.transition(),
|
524
|
-
$transition =
|
524
|
+
$transition = transition == 'overlay' || module.othersActive()
|
525
525
|
? $module
|
526
526
|
: $pusher,
|
527
527
|
animate,
|
@@ -709,9 +709,11 @@
|
|
709
709
|
direction: function () {
|
710
710
|
if ($module.hasClass(className.top)) {
|
711
711
|
return className.top;
|
712
|
-
}
|
712
|
+
}
|
713
|
+
if ($module.hasClass(className.right)) {
|
713
714
|
return className.right;
|
714
|
-
}
|
715
|
+
}
|
716
|
+
if ($module.hasClass(className.bottom)) {
|
715
717
|
return className.bottom;
|
716
718
|
}
|
717
719
|
|
@@ -722,13 +724,13 @@
|
|
722
724
|
direction = module.get.direction(),
|
723
725
|
transition
|
724
726
|
;
|
725
|
-
transition =
|
726
|
-
? (settings.mobileTransition == 'auto'
|
727
|
+
transition = module.is.mobile()
|
728
|
+
? (settings.mobileTransition == 'auto'
|
727
729
|
? settings.defaultTransition.mobile[direction]
|
728
|
-
: settings.mobileTransition
|
729
|
-
: (settings.transition == 'auto'
|
730
|
+
: settings.mobileTransition)
|
731
|
+
: (settings.transition == 'auto'
|
730
732
|
? settings.defaultTransition.computer[direction]
|
731
|
-
: settings.transition;
|
733
|
+
: settings.transition);
|
732
734
|
module.verbose('Determined transition', transition);
|
733
735
|
|
734
736
|
return transition;
|
@@ -784,10 +786,10 @@
|
|
784
786
|
ie: function () {
|
785
787
|
if (module.cache.isIE === undefined) {
|
786
788
|
var
|
787
|
-
isIE11 =
|
788
|
-
isIE =
|
789
|
+
isIE11 = !window.ActiveXObject && 'ActiveXObject' in window,
|
790
|
+
isIE = 'ActiveXObject' in window
|
789
791
|
;
|
790
|
-
module.cache.isIE =
|
792
|
+
module.cache.isIE = isIE11 || isIE;
|
791
793
|
}
|
792
794
|
|
793
795
|
return module.cache.isIE;
|
@@ -803,9 +805,9 @@
|
|
803
805
|
module.verbose('Browser was found to be iOS', userAgent);
|
804
806
|
|
805
807
|
return true;
|
806
|
-
} else {
|
807
|
-
return false;
|
808
808
|
}
|
809
|
+
|
810
|
+
return false;
|
809
811
|
},
|
810
812
|
mobile: function () {
|
811
813
|
var
|
@@ -816,11 +818,11 @@
|
|
816
818
|
module.verbose('Browser was found to be mobile', userAgent);
|
817
819
|
|
818
820
|
return true;
|
819
|
-
} else {
|
820
|
-
module.verbose('Browser is not mobile, using regular transition', userAgent);
|
821
|
-
|
822
|
-
return false;
|
823
821
|
}
|
822
|
+
|
823
|
+
module.verbose('Browser is not mobile, using regular transition', userAgent);
|
824
|
+
|
825
|
+
return false;
|
824
826
|
},
|
825
827
|
hidden: function () {
|
826
828
|
return !module.is.visible();
|
@@ -907,7 +909,7 @@
|
|
907
909
|
previousTime
|
908
910
|
;
|
909
911
|
if (settings.performance) {
|
910
|
-
currentTime =
|
912
|
+
currentTime = Date.now();
|
911
913
|
previousTime = time || currentTime;
|
912
914
|
executionTime = currentTime - previousTime;
|
913
915
|
time = currentTime;
|
@@ -958,11 +960,11 @@
|
|
958
960
|
;
|
959
961
|
passedArguments = passedArguments || queryArguments;
|
960
962
|
context = context || element;
|
961
|
-
if (typeof query
|
962
|
-
query = query.split(/[
|
963
|
+
if (typeof query === 'string' && object !== undefined) {
|
964
|
+
query = query.split(/[ .]/);
|
963
965
|
maxDepth = query.length - 1;
|
964
966
|
$.each(query, function (depth, value) {
|
965
|
-
var camelCaseValue =
|
967
|
+
var camelCaseValue = depth != maxDepth
|
966
968
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
967
969
|
: query
|
968
970
|
;
|
@@ -1015,7 +1017,7 @@
|
|
1015
1017
|
}
|
1016
1018
|
});
|
1017
1019
|
|
1018
|
-
return
|
1020
|
+
return returnedValue !== undefined
|
1019
1021
|
? returnedValue
|
1020
1022
|
: this;
|
1021
1023
|
};
|
@@ -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,11 +27,11 @@
|
|
27
27
|
|
28
28
|
moduleSelector = $allModules.selector || '',
|
29
29
|
|
30
|
-
time =
|
30
|
+
time = Date.now(),
|
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
|
|
@@ -138,7 +138,7 @@
|
|
138
138
|
if ($module.attr('tabindex') === undefined) {
|
139
139
|
$module.attr('tabindex', 0);
|
140
140
|
}
|
141
|
-
if ($module.find('.inner').length
|
141
|
+
if ($module.find('.inner').length === 0) {
|
142
142
|
$module.append("<div class='inner'>"
|
143
143
|
+ "<div class='track'></div>"
|
144
144
|
+ "<div class='track-fill'></div>"
|
@@ -149,7 +149,7 @@
|
|
149
149
|
$thumb = $module.find('.thumb:not(.second)');
|
150
150
|
$currThumb = $thumb;
|
151
151
|
if (module.is.range()) {
|
152
|
-
if ($module.find('.thumb.second').length
|
152
|
+
if ($module.find('.thumb.second').length === 0) {
|
153
153
|
$module.find('.inner').append("<div class='thumb second'></div>");
|
154
154
|
}
|
155
155
|
$secondThumb = $module.find('.thumb.second');
|
@@ -161,7 +161,7 @@
|
|
161
161
|
labels: function () {
|
162
162
|
if (module.is.labeled()) {
|
163
163
|
$labels = $module.find('.labels:not(.auto)');
|
164
|
-
if ($labels.length
|
164
|
+
if ($labels.length > 0) {
|
165
165
|
module.setup.customLabel();
|
166
166
|
} else {
|
167
167
|
module.setup.autoLabel();
|
@@ -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);
|
@@ -196,7 +198,7 @@
|
|
196
198
|
},
|
197
199
|
autoLabel: function () {
|
198
200
|
$labels = $module.find('.labels');
|
199
|
-
if ($labels.length
|
201
|
+
if ($labels.length > 0) {
|
200
202
|
$labels.empty();
|
201
203
|
} else {
|
202
204
|
$labels = $module.append('<ul class="auto labels"></ul>').find('.labels');
|
@@ -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
|
;
|
@@ -523,23 +525,23 @@
|
|
523
525
|
trackOffset: function () {
|
524
526
|
if (module.is.vertical()) {
|
525
527
|
return $track.offset().top;
|
526
|
-
} else {
|
527
|
-
return $track.offset().left;
|
528
528
|
}
|
529
|
+
|
530
|
+
return $track.offset().left;
|
529
531
|
},
|
530
532
|
trackLength: function () {
|
531
533
|
if (module.is.vertical()) {
|
532
534
|
return $track.height();
|
533
|
-
} else {
|
534
|
-
return $track.width();
|
535
535
|
}
|
536
|
+
|
537
|
+
return $track.width();
|
536
538
|
},
|
537
539
|
trackLeft: function () {
|
538
540
|
if (module.is.vertical()) {
|
539
541
|
return $track.position().top;
|
540
|
-
} else {
|
541
|
-
return $track.position().left;
|
542
542
|
}
|
543
|
+
|
544
|
+
return $track.position().left;
|
543
545
|
},
|
544
546
|
trackStartPos: function () {
|
545
547
|
return module.is.reversed() ? module.get.trackLeft() + module.get.trackLength() : module.get.trackLeft();
|
@@ -574,11 +576,7 @@
|
|
574
576
|
;
|
575
577
|
if (step != 0) {
|
576
578
|
var split = String(step).split('.');
|
577
|
-
|
578
|
-
decimalPlaces = split[1].length;
|
579
|
-
} else {
|
580
|
-
decimalPlaces = 0;
|
581
|
-
}
|
579
|
+
decimalPlaces = split.length == 2 ? split[1].length : 0;
|
582
580
|
} else {
|
583
581
|
decimalPlaces = settings.decimalPlaces;
|
584
582
|
}
|
@@ -621,7 +619,7 @@
|
|
621
619
|
case settings.labelTypes.number:
|
622
620
|
return Math.round(((value * (module.get.step() === 0 ? 1 : module.get.step())) + module.get.min()) * precision) / precision;
|
623
621
|
case settings.labelTypes.letter:
|
624
|
-
return alphabet[
|
622
|
+
return alphabet[value % 26];
|
625
623
|
default:
|
626
624
|
return value;
|
627
625
|
}
|
@@ -637,12 +635,12 @@
|
|
637
635
|
case 'second':
|
638
636
|
if (module.is.range()) {
|
639
637
|
return module.secondThumbVal;
|
640
|
-
} else {
|
641
|
-
module.error(error.notrange);
|
642
|
-
|
643
|
-
break;
|
644
638
|
}
|
645
|
-
|
639
|
+
|
640
|
+
module.error(error.notrange);
|
641
|
+
|
642
|
+
break;
|
643
|
+
|
646
644
|
default:
|
647
645
|
return module.thumbVal;
|
648
646
|
}
|
@@ -655,12 +653,12 @@
|
|
655
653
|
case 'second':
|
656
654
|
if (module.is.range()) {
|
657
655
|
return secondPos;
|
658
|
-
} else {
|
659
|
-
module.error(error.notrange);
|
660
|
-
|
661
|
-
break;
|
662
656
|
}
|
663
|
-
|
657
|
+
|
658
|
+
module.error(error.notrange);
|
659
|
+
|
660
|
+
break;
|
661
|
+
|
664
662
|
default:
|
665
663
|
return position;
|
666
664
|
}
|
@@ -724,8 +722,8 @@
|
|
724
722
|
thumbPos: function ($element) {
|
725
723
|
var
|
726
724
|
pos = module.is.vertical()
|
727
|
-
? module.is.reversed() ? $element.css('bottom') : $element.css('top')
|
728
|
-
: module.is.reversed() ? $element.css('right') : $element.css('left')
|
725
|
+
? (module.is.reversed() ? $element.css('bottom') : $element.css('top'))
|
726
|
+
: (module.is.reversed() ? $element.css('right') : $element.css('left'))
|
729
727
|
;
|
730
728
|
|
731
729
|
return pos;
|
@@ -734,7 +732,9 @@
|
|
734
732
|
var
|
735
733
|
min = module.get.min(),
|
736
734
|
max = module.get.max(),
|
737
|
-
value = val > max
|
735
|
+
value = val > max
|
736
|
+
? max
|
737
|
+
: (val < min ? min : val),
|
738
738
|
trackLength = module.get.trackLength(),
|
739
739
|
ratio = (value - min) / (max - min),
|
740
740
|
position = Math.round(ratio * trackLength)
|
@@ -748,7 +748,7 @@
|
|
748
748
|
trackLength = module.get.trackLength(),
|
749
749
|
step = module.get.step(),
|
750
750
|
position = Math.round(ratio * trackLength),
|
751
|
-
adjustedPos =
|
751
|
+
adjustedPos = step == 0 ? position : Math.round(position / step) * step
|
752
752
|
;
|
753
753
|
|
754
754
|
return adjustedPos;
|
@@ -779,7 +779,9 @@
|
|
779
779
|
ratio,
|
780
780
|
value
|
781
781
|
;
|
782
|
-
newPos = newPos < 0
|
782
|
+
newPos = newPos < 0
|
783
|
+
? 0
|
784
|
+
: (newPos > trackLength ? trackLength : newPos);
|
783
785
|
ratio = newPos / trackLength;
|
784
786
|
if (module.is.reversed()) {
|
785
787
|
ratio = 1 - ratio;
|
@@ -821,8 +823,8 @@
|
|
821
823
|
ratio = (position - startPos) / (endPos - startPos),
|
822
824
|
range = module.get.max() - module.get.min(),
|
823
825
|
step = module.get.step(),
|
824
|
-
value =
|
825
|
-
difference =
|
826
|
+
value = ratio * range,
|
827
|
+
difference = step == 0 ? value : Math.round(value / step) * step
|
826
828
|
;
|
827
829
|
module.verbose('Determined value based upon position: ' + position + ' as: ' + value);
|
828
830
|
if (value != difference) {
|
@@ -838,29 +840,32 @@
|
|
838
840
|
var
|
839
841
|
key = event.which,
|
840
842
|
downArrow = module.is.vertical()
|
841
|
-
? module.is.reversed() ? keys.downArrow : keys.upArrow
|
843
|
+
? (module.is.reversed() ? keys.downArrow : keys.upArrow)
|
842
844
|
: keys.downArrow,
|
843
845
|
upArrow = module.is.vertical()
|
844
|
-
? module.is.reversed() ? keys.upArrow : keys.downArrow
|
846
|
+
? (module.is.reversed() ? keys.upArrow : keys.downArrow)
|
845
847
|
: keys.upArrow,
|
846
848
|
leftArrow = !module.is.vertical()
|
847
|
-
? module.is.reversed() ? keys.rightArrow : keys.leftArrow
|
849
|
+
? (module.is.reversed() ? keys.rightArrow : keys.leftArrow)
|
848
850
|
: keys.leftArrow,
|
849
851
|
rightArrow = !module.is.vertical()
|
850
|
-
? module.is.reversed() ? keys.leftArrow : keys.rightArrow
|
852
|
+
? (module.is.reversed() ? keys.leftArrow : keys.rightArrow)
|
851
853
|
: keys.rightArrow
|
852
854
|
;
|
853
855
|
if (key == downArrow || key == leftArrow) {
|
854
856
|
return SINGLE_BACKSTEP;
|
855
|
-
}
|
857
|
+
}
|
858
|
+
if (key == upArrow || key == rightArrow) {
|
856
859
|
return SINGLE_STEP;
|
857
|
-
}
|
860
|
+
}
|
861
|
+
if (key == keys.pageDown) {
|
858
862
|
return BIG_BACKSTEP;
|
859
|
-
}
|
863
|
+
}
|
864
|
+
if (key == keys.pageUp) {
|
860
865
|
return BIG_STEP;
|
861
|
-
} else {
|
862
|
-
return NO_STEP;
|
863
866
|
}
|
867
|
+
|
868
|
+
return NO_STEP;
|
864
869
|
},
|
865
870
|
},
|
866
871
|
|
@@ -1009,8 +1014,8 @@
|
|
1009
1014
|
thumbPosValue,
|
1010
1015
|
min = module.get.min(),
|
1011
1016
|
max = module.get.max(),
|
1012
|
-
thumbPosPercent = 100 * (newValue - min) / (max - min),
|
1013
|
-
trackStartPosPercent = 100 * (Math.min(thumbVal, secondThumbVal) - min) / (max - min),
|
1017
|
+
thumbPosPercent = 100 * ((newValue - min) / (max - min)),
|
1018
|
+
trackStartPosPercent = 100 * ((Math.min(thumbVal, secondThumbVal) - min) / (max - min)),
|
1014
1019
|
trackEndPosPercent = 100 * (1 - (Math.max(thumbVal, secondThumbVal) - min) / (max - min))
|
1015
1020
|
;
|
1016
1021
|
if (module.is.vertical()) {
|
@@ -1039,9 +1044,11 @@
|
|
1039
1044
|
startMargin = module.get.trackStartMargin(),
|
1040
1045
|
endMargin = module.get.trackEndMargin(),
|
1041
1046
|
posDir = module.is.vertical()
|
1042
|
-
? module.is.reversed() ? 'bottom' : 'top'
|
1043
|
-
: module.is.reversed() ? 'right' : 'left',
|
1044
|
-
startMarginMod = module.is.reversed() && !module.is.vertical()
|
1047
|
+
? (module.is.reversed() ? 'bottom' : 'top')
|
1048
|
+
: (module.is.reversed() ? 'right' : 'left'),
|
1049
|
+
startMarginMod = module.is.reversed() && !module.is.vertical()
|
1050
|
+
? ' - '
|
1051
|
+
: ' + '
|
1045
1052
|
;
|
1046
1053
|
var position = '(100% - ' + startMargin + ' - ' + endMargin + ') * ' + ratio;
|
1047
1054
|
$label.css(posDir, 'calc(' + position + startMarginMod + startMargin + ')');
|
@@ -1146,7 +1153,7 @@
|
|
1146
1153
|
previousTime
|
1147
1154
|
;
|
1148
1155
|
if (settings.performance) {
|
1149
|
-
currentTime =
|
1156
|
+
currentTime = Date.now();
|
1150
1157
|
previousTime = time || currentTime;
|
1151
1158
|
executionTime = currentTime - previousTime;
|
1152
1159
|
time = currentTime;
|
@@ -1198,11 +1205,11 @@
|
|
1198
1205
|
;
|
1199
1206
|
passedArguments = passedArguments || queryArguments;
|
1200
1207
|
context = context || element;
|
1201
|
-
if (typeof query
|
1202
|
-
query = query.split(/[
|
1208
|
+
if (typeof query === 'string' && object !== undefined) {
|
1209
|
+
query = query.split(/[ .]/);
|
1203
1210
|
maxDepth = query.length - 1;
|
1204
1211
|
$.each(query, function (depth, value) {
|
1205
|
-
var camelCaseValue =
|
1212
|
+
var camelCaseValue = depth != maxDepth
|
1206
1213
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
1207
1214
|
: query
|
1208
1215
|
;
|
@@ -1255,7 +1262,7 @@
|
|
1255
1262
|
}
|
1256
1263
|
});
|
1257
1264
|
|
1258
|
-
return
|
1265
|
+
return returnedValue !== undefined
|
1259
1266
|
? returnedValue
|
1260
1267
|
: this;
|
1261
1268
|
};
|
@@ -1300,9 +1307,7 @@
|
|
1300
1307
|
// page up/down multiplier. How many more times the steps to take on page up/down press
|
1301
1308
|
pageMultiplier: 2,
|
1302
1309
|
|
1303
|
-
selector: {
|
1304
|
-
|
1305
|
-
},
|
1310
|
+
selector: {},
|
1306
1311
|
|
1307
1312
|
className: {
|
1308
1313
|
reversed: 'reversed',
|