fomantic-ui 2.9.1-beta.24 → 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 +3 -0
- package/.eslintrc.js +1 -2
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +4 -4
- 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 +17 -17
- 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 +18 -17
- 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 +11 -11
- 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 +9 -9
- 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 +103 -91
- 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 +5 -5
- 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 +10 -10
- 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 +77 -60
- 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 +4 -4
- 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 +5 -5
- 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 +39 -31
- 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 +12 -12
- 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 +6 -6
- 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 +16 -16
- 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 +5 -5
- 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 +13 -13
- 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 +4 -4
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +50 -37
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +5 -5
- 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 +8 -8
- 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 +17 -17
- 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 +4 -4
- 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 +8 -8
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +12 -12
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +50 -50
- package/dist/semantic.js +462 -411
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/definitions/behaviors/api.js +16 -16
- package/src/definitions/behaviors/form.js +76 -59
- package/src/definitions/behaviors/state.js +4 -4
- package/src/definitions/behaviors/visibility.js +11 -11
- package/src/definitions/globals/site.js +3 -3
- package/src/definitions/modules/accordion.js +3 -3
- package/src/definitions/modules/calendar.js +17 -16
- package/src/definitions/modules/checkbox.js +10 -10
- package/src/definitions/modules/dimmer.js +8 -8
- package/src/definitions/modules/dropdown.js +102 -90
- package/src/definitions/modules/embed.js +4 -4
- package/src/definitions/modules/flyout.js +9 -9
- package/src/definitions/modules/modal.js +3 -3
- package/src/definitions/modules/nag.js +4 -4
- package/src/definitions/modules/popup.js +38 -30
- package/src/definitions/modules/progress.js +11 -11
- package/src/definitions/modules/rating.js +5 -5
- package/src/definitions/modules/search.js +15 -15
- package/src/definitions/modules/shape.js +4 -4
- package/src/definitions/modules/sidebar.js +12 -12
- package/src/definitions/modules/slider.js +49 -36
- package/src/definitions/modules/sticky.js +7 -7
- package/src/definitions/modules/tab.js +16 -16
- package/src/definitions/modules/toast.js +3 -3
- package/src/definitions/modules/transition.js +7 -7
- package/tasks/admin/components/init.js +1 -1
- package/tasks/admin/components/update.js +1 -1
- package/tasks/admin/distributions/create.js +4 -5
- package/tasks/admin/distributions/init.js +1 -1
- package/tasks/admin/distributions/update.js +1 -1
- package/tasks/config/project/config.js +2 -2
- package/tasks/config/project/install.js +8 -8
- package/tasks/config/project/release.js +1 -1
- package/tasks/config/tasks.js +2 -2
- package/tasks/docs/metadata.js +1 -1
- package/tasks/install.js +2 -2
- package/test/modules/module.spec.js +1 -1
package/package.json
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
'use strict';
|
13
13
|
|
14
14
|
function isWindow(obj) {
|
15
|
-
return obj
|
15
|
+
return obj !== null && obj === obj.window;
|
16
16
|
}
|
17
17
|
|
18
18
|
function isFunction(obj) {
|
@@ -117,7 +117,7 @@
|
|
117
117
|
$module
|
118
118
|
.on(triggerEvent + eventNamespace, module.event.trigger)
|
119
119
|
;
|
120
|
-
} else if (settings.on
|
120
|
+
} else if (settings.on === 'now') {
|
121
121
|
module.debug('Querying API endpoint immediately');
|
122
122
|
module.query();
|
123
123
|
}
|
@@ -296,7 +296,7 @@
|
|
296
296
|
},
|
297
297
|
loading: function () {
|
298
298
|
return module.request
|
299
|
-
? module.request.state()
|
299
|
+
? module.request.state() === 'pending'
|
300
300
|
: false;
|
301
301
|
},
|
302
302
|
abortedRequest: function (xhr) {
|
@@ -334,13 +334,13 @@
|
|
334
334
|
return module.cancelled || false;
|
335
335
|
},
|
336
336
|
successful: function () {
|
337
|
-
return module.request && module.request.state()
|
337
|
+
return module.request && module.request.state() === 'resolved';
|
338
338
|
},
|
339
339
|
failure: function () {
|
340
|
-
return module.request && module.request.state()
|
340
|
+
return module.request && module.request.state() === 'rejected';
|
341
341
|
},
|
342
342
|
complete: function () {
|
343
|
-
return module.request && (module.request.state()
|
343
|
+
return module.request && (module.request.state() === 'resolved' || module.request.state() === 'rejected');
|
344
344
|
},
|
345
345
|
},
|
346
346
|
|
@@ -478,7 +478,7 @@
|
|
478
478
|
while (nameKeys.length > 0) {
|
479
479
|
var k = nameKeys.pop();
|
480
480
|
|
481
|
-
if (k
|
481
|
+
if (k === '' && !Array.isArray(value)) { // foo[]
|
482
482
|
value = build([], pushes[pushKey]++, value);
|
483
483
|
} else if (settings.regExp.fixed.test(k)) { // foo[n]
|
484
484
|
value = build([], k, value);
|
@@ -525,7 +525,7 @@
|
|
525
525
|
event: {
|
526
526
|
trigger: function (event) {
|
527
527
|
module.query();
|
528
|
-
if (event.type
|
528
|
+
if (event.type === 'submit' || event.type === 'click') {
|
529
529
|
event.preventDefault();
|
530
530
|
}
|
531
531
|
},
|
@@ -614,15 +614,15 @@
|
|
614
614
|
response = module.get.responseFromXHR(xhr),
|
615
615
|
errorMessage = module.get.errorFromRequest(response, status, httpMessage)
|
616
616
|
;
|
617
|
-
if (status
|
617
|
+
if (status === 'aborted') {
|
618
618
|
module.debug('XHR Aborted (Most likely caused by page navigation or CORS Policy)', status, httpMessage);
|
619
619
|
settings.onAbort.call(context, status, $module, xhr);
|
620
620
|
|
621
621
|
return true;
|
622
622
|
}
|
623
|
-
if (status
|
623
|
+
if (status === 'invalid') {
|
624
624
|
module.debug('JSON did not pass success test. A server-side error has most likely occurred', response);
|
625
|
-
} else if (status
|
625
|
+
} else if (status === 'error') {
|
626
626
|
if (xhr !== undefined) {
|
627
627
|
module.debug('XHR produced a server error', status, httpMessage);
|
628
628
|
// make sure we have an error to display to console
|
@@ -829,12 +829,12 @@
|
|
829
829
|
return data;
|
830
830
|
},
|
831
831
|
event: function () {
|
832
|
-
if (isWindow(element) || settings.on
|
832
|
+
if (isWindow(element) || settings.on === 'now') {
|
833
833
|
module.debug('API called without element, no events attached');
|
834
834
|
|
835
835
|
return false;
|
836
836
|
}
|
837
|
-
if (settings.on
|
837
|
+
if (settings.on === 'auto') {
|
838
838
|
if ($module.is('input')) {
|
839
839
|
return element.oninput !== undefined
|
840
840
|
? 'input'
|
@@ -1004,17 +1004,17 @@
|
|
1004
1004
|
query = query.split(/[ .]/);
|
1005
1005
|
maxDepth = query.length - 1;
|
1006
1006
|
$.each(query, function (depth, value) {
|
1007
|
-
var camelCaseValue = depth
|
1007
|
+
var camelCaseValue = depth !== maxDepth
|
1008
1008
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
1009
1009
|
: query
|
1010
1010
|
;
|
1011
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
1011
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
1012
1012
|
object = object[camelCaseValue];
|
1013
1013
|
} else if (object[camelCaseValue] !== undefined) {
|
1014
1014
|
found = object[camelCaseValue];
|
1015
1015
|
|
1016
1016
|
return false;
|
1017
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
1017
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
1018
1018
|
object = object[value];
|
1019
1019
|
} else if (object[value] !== undefined) {
|
1020
1020
|
found = object[value];
|
@@ -345,14 +345,14 @@
|
|
345
345
|
},
|
346
346
|
fieldDirty: function ($el) {
|
347
347
|
var initialValue = $el.data(metadata.defaultValue);
|
348
|
-
// Explicitly check for null
|
349
|
-
if (initialValue
|
348
|
+
// Explicitly check for undefined/null here as value may be `false`, so ($el.data(dataInitialValue) || '') would not work
|
349
|
+
if (initialValue === undefined || initialValue === null) {
|
350
350
|
initialValue = '';
|
351
351
|
} else if (Array.isArray(initialValue)) {
|
352
352
|
initialValue = initialValue.toString();
|
353
353
|
}
|
354
354
|
var currentValue = $el.val();
|
355
|
-
if (currentValue
|
355
|
+
if (currentValue === undefined || currentValue === null) {
|
356
356
|
currentValue = '';
|
357
357
|
} else if (Array.isArray(currentValue)) {
|
358
358
|
// multiple select values are returned as arrays which are never equal, so do string conversion first
|
@@ -403,13 +403,13 @@
|
|
403
403
|
escape: 27,
|
404
404
|
}
|
405
405
|
;
|
406
|
-
if (key
|
406
|
+
if (key === keyCode.escape) {
|
407
407
|
module.verbose('Escape key pressed blurring field');
|
408
408
|
$field[0]
|
409
409
|
.blur()
|
410
410
|
;
|
411
411
|
}
|
412
|
-
if (!event.ctrlKey && key
|
412
|
+
if (!event.ctrlKey && key === keyCode.enter && isInput && !isInDropdown && !isCheckbox) {
|
413
413
|
if (!keyHeldDown) {
|
414
414
|
$field.one('keyup' + eventNamespace, module.event.field.keyup);
|
415
415
|
module.submit();
|
@@ -428,7 +428,7 @@
|
|
428
428
|
$fieldGroup = $field.closest($group),
|
429
429
|
validationRules = module.get.validation($field)
|
430
430
|
;
|
431
|
-
if (validationRules && (settings.on
|
431
|
+
if (validationRules && (settings.on === 'blur' || ($fieldGroup.hasClass(className.error) && settings.revalidate))) {
|
432
432
|
module.debug('Revalidating field', $field, validationRules);
|
433
433
|
module.validate.field(validationRules);
|
434
434
|
if (!settings.inline) {
|
@@ -442,7 +442,7 @@
|
|
442
442
|
$fieldGroup = $field.closest($group),
|
443
443
|
validationRules = module.get.validation($field)
|
444
444
|
;
|
445
|
-
if (validationRules && (settings.on
|
445
|
+
if (validationRules && (settings.on === 'change' || ($fieldGroup.hasClass(className.error) && settings.revalidate))) {
|
446
446
|
clearTimeout(module.timer);
|
447
447
|
module.timer = setTimeout(function () {
|
448
448
|
module.debug('Revalidating field', $field, validationRules);
|
@@ -488,7 +488,7 @@
|
|
488
488
|
return rule.type;
|
489
489
|
},
|
490
490
|
changeEvent: function (type, $input) {
|
491
|
-
if (type
|
491
|
+
if (type === 'checkbox' || type === 'radio' || type === 'hidden' || $input.is('select')) {
|
492
492
|
return 'change';
|
493
493
|
}
|
494
494
|
|
@@ -557,7 +557,7 @@
|
|
557
557
|
}
|
558
558
|
if (requiresName) {
|
559
559
|
$label = $field.closest(selector.group).find('label').eq(0);
|
560
|
-
name = $label.length
|
560
|
+
name = $label.length === 1
|
561
561
|
? $label.text()
|
562
562
|
: $field.prop('placeholder') || settings.text.unspecifiedField;
|
563
563
|
prompt = prompt.replace(/{name}/g, name);
|
@@ -730,42 +730,53 @@
|
|
730
730
|
var date = $calendar.calendar('get date');
|
731
731
|
|
732
732
|
if (date !== null) {
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
values[name] = $calendar.calendar('get input date');
|
737
|
-
} else if (settings.dateHandling == 'formatter') {
|
738
|
-
var type = $calendar.calendar('setting', 'type');
|
733
|
+
switch (settings.dateHandling) {
|
734
|
+
case 'date': {
|
735
|
+
values[name] = date;
|
739
736
|
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
break;
|
745
|
-
|
746
|
-
case 'datetime':
|
747
|
-
values[name] = settings.formatter.datetime(date);
|
748
|
-
|
749
|
-
break;
|
750
|
-
|
751
|
-
case 'time':
|
752
|
-
values[name] = settings.formatter.time(date);
|
753
|
-
|
754
|
-
break;
|
755
|
-
|
756
|
-
case 'month':
|
757
|
-
values[name] = settings.formatter.month(date);
|
758
|
-
|
759
|
-
break;
|
760
|
-
|
761
|
-
case 'year':
|
762
|
-
values[name] = settings.formatter.year(date);
|
763
|
-
|
764
|
-
break;
|
737
|
+
break;
|
738
|
+
}
|
739
|
+
case 'input': {
|
740
|
+
values[name] = $calendar.calendar('get input date');
|
765
741
|
|
766
|
-
|
767
|
-
|
768
|
-
|
742
|
+
break;
|
743
|
+
}
|
744
|
+
case 'formatter': {
|
745
|
+
var type = $calendar.calendar('setting', 'type');
|
746
|
+
|
747
|
+
switch (type) {
|
748
|
+
case 'date': {
|
749
|
+
values[name] = settings.formatter.date(date);
|
750
|
+
|
751
|
+
break;
|
752
|
+
}
|
753
|
+
case 'datetime': {
|
754
|
+
values[name] = settings.formatter.datetime(date);
|
755
|
+
|
756
|
+
break;
|
757
|
+
}
|
758
|
+
case 'time': {
|
759
|
+
values[name] = settings.formatter.time(date);
|
760
|
+
|
761
|
+
break;
|
762
|
+
}
|
763
|
+
case 'month': {
|
764
|
+
values[name] = settings.formatter.month(date);
|
765
|
+
|
766
|
+
break;
|
767
|
+
}
|
768
|
+
case 'year': {
|
769
|
+
values[name] = settings.formatter.year(date);
|
770
|
+
|
771
|
+
break;
|
772
|
+
}
|
773
|
+
default: {
|
774
|
+
module.debug('Wrong calendar mode', $calendar, type);
|
775
|
+
values[name] = '';
|
776
|
+
}
|
777
|
+
}
|
778
|
+
|
779
|
+
break;
|
769
780
|
}
|
770
781
|
}
|
771
782
|
} else {
|
@@ -854,7 +865,7 @@
|
|
854
865
|
// For each new rule, check if there's not already one with the same type
|
855
866
|
$.each(newValidation.rules, function (_index, rule) {
|
856
867
|
if ($.grep(validation[name].rules, function (item) {
|
857
|
-
return item.type
|
868
|
+
return item.type === rule.type;
|
858
869
|
}).length === 0) {
|
859
870
|
validation[name].rules.push(rule);
|
860
871
|
}
|
@@ -1139,7 +1150,7 @@
|
|
1139
1150
|
validation = module.get.validation($el),
|
1140
1151
|
hasEmptyRule = validation
|
1141
1152
|
? $.grep(validation.rules, function (rule) {
|
1142
|
-
return rule.type
|
1153
|
+
return rule.type === 'empty';
|
1143
1154
|
}) !== 0
|
1144
1155
|
: false,
|
1145
1156
|
identifier = validation.identifier || $el.attr('id') || $el.attr('name') || $el.data(metadata.validate)
|
@@ -1158,7 +1169,7 @@
|
|
1158
1169
|
optional: function (identifier, bool) {
|
1159
1170
|
bool = bool !== false;
|
1160
1171
|
$.each(validation, function (fieldName, field) {
|
1161
|
-
if (identifier
|
1172
|
+
if (identifier === fieldName || identifier === field.identifier) {
|
1162
1173
|
field.optional = bool;
|
1163
1174
|
}
|
1164
1175
|
});
|
@@ -1442,16 +1453,16 @@
|
|
1442
1453
|
query = query.split(/[ .]/);
|
1443
1454
|
maxDepth = query.length - 1;
|
1444
1455
|
$.each(query, function (depth, value) {
|
1445
|
-
var camelCaseValue = depth
|
1456
|
+
var camelCaseValue = depth !== maxDepth
|
1446
1457
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
1447
1458
|
: query;
|
1448
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
1459
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
1449
1460
|
object = object[camelCaseValue];
|
1450
1461
|
} else if (object[camelCaseValue] !== undefined) {
|
1451
1462
|
found = object[camelCaseValue];
|
1452
1463
|
|
1453
1464
|
return false;
|
1454
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
1465
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
1455
1466
|
object = object[value];
|
1456
1467
|
} else if (object[value] !== undefined) {
|
1457
1468
|
found = object[value];
|
@@ -1748,7 +1759,7 @@
|
|
1748
1759
|
if (!range || ['', '..'].indexOf(range) !== -1) {
|
1749
1760
|
|
1750
1761
|
// do nothing
|
1751
|
-
} else if (range.indexOf('..')
|
1762
|
+
} else if (range.indexOf('..') === -1) {
|
1752
1763
|
if (regExp.test(range)) {
|
1753
1764
|
min = range - 0;
|
1754
1765
|
max = min;
|
@@ -1856,7 +1867,7 @@
|
|
1856
1867
|
// is exactly length
|
1857
1868
|
exactLength: function (value, requiredLength) {
|
1858
1869
|
return value !== undefined
|
1859
|
-
? value.length
|
1870
|
+
? value.length === Number(requiredLength)
|
1860
1871
|
: false;
|
1861
1872
|
},
|
1862
1873
|
|
@@ -1894,7 +1905,7 @@
|
|
1894
1905
|
}
|
1895
1906
|
|
1896
1907
|
return matchingValue !== undefined
|
1897
|
-
? value.toString()
|
1908
|
+
? value.toString() === matchingValue.toString()
|
1898
1909
|
: false;
|
1899
1910
|
},
|
1900
1911
|
|
@@ -2039,10 +2050,12 @@
|
|
2039
2050
|
},
|
2040
2051
|
|
2041
2052
|
minCount: function (value, minCount) {
|
2042
|
-
|
2053
|
+
minCount = Number(minCount);
|
2054
|
+
|
2055
|
+
if (minCount === 0) {
|
2043
2056
|
return true;
|
2044
2057
|
}
|
2045
|
-
if (minCount
|
2058
|
+
if (minCount === 1) {
|
2046
2059
|
return value !== '';
|
2047
2060
|
}
|
2048
2061
|
|
@@ -2050,21 +2063,25 @@
|
|
2050
2063
|
},
|
2051
2064
|
|
2052
2065
|
exactCount: function (value, exactCount) {
|
2053
|
-
|
2066
|
+
exactCount = Number(exactCount);
|
2067
|
+
|
2068
|
+
if (exactCount === 0) {
|
2054
2069
|
return value === '';
|
2055
2070
|
}
|
2056
|
-
if (exactCount
|
2071
|
+
if (exactCount === 1) {
|
2057
2072
|
return value !== '' && value.search(',') === -1;
|
2058
2073
|
}
|
2059
2074
|
|
2060
|
-
return value.split(',').length
|
2075
|
+
return value.split(',').length === exactCount;
|
2061
2076
|
},
|
2062
2077
|
|
2063
2078
|
maxCount: function (value, maxCount) {
|
2064
|
-
|
2079
|
+
maxCount = Number(maxCount);
|
2080
|
+
|
2081
|
+
if (maxCount === 0) {
|
2065
2082
|
return false;
|
2066
2083
|
}
|
2067
|
-
if (maxCount
|
2084
|
+
if (maxCount === 1) {
|
2068
2085
|
return value.search(',') === -1;
|
2069
2086
|
}
|
2070
2087
|
|
@@ -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;
|
@@ -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 = depth
|
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];
|
@@ -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
|
}
|
@@ -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);
|
@@ -432,7 +432,7 @@
|
|
432
432
|
: false
|
433
433
|
;
|
434
434
|
|
435
|
-
return overflowY
|
435
|
+
return overflowY === 'auto' || overflowY === 'scroll';
|
436
436
|
},
|
437
437
|
horizontallyScrollableContext: function () {
|
438
438
|
var
|
@@ -441,13 +441,13 @@
|
|
441
441
|
: false
|
442
442
|
;
|
443
443
|
|
444
|
-
return overflowX
|
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();
|
@@ -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 = depth
|
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];
|
@@ -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 = depth
|
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];
|
@@ -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 = depth
|
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];
|