fomantic-ui 2.9.1-beta.15 → 2.9.1-beta.17
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/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +14 -12
- 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 +15 -12
- 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 +21 -21
- 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 +7 -7
- 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 +8 -8
- 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 +28 -24
- 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 +4 -4
- 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 +26 -24
- 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 +15 -15
- 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 +30 -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 +6 -6
- 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 +9 -9
- 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 +8 -8
- 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 +4 -4
- 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 +12 -12
- 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 +9 -9
- 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 +10 -15
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +18 -13
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +4 -4
- 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 +10 -9
- 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 +11 -11
- 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 +28 -25
- 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 +4 -4
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +5 -5
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +50 -50
- package/dist/semantic.js +312 -295
- 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 +14 -11
- package/src/definitions/behaviors/form.js +14 -14
- package/src/definitions/behaviors/state.js +3 -3
- package/src/definitions/behaviors/visibility.js +4 -4
- package/src/definitions/globals/site.js +9 -14
- package/src/definitions/modules/accordion.js +13 -11
- package/src/definitions/modules/calendar.js +20 -20
- package/src/definitions/modules/checkbox.js +6 -6
- package/src/definitions/modules/dimmer.js +7 -7
- package/src/definitions/modules/dropdown.js +27 -23
- package/src/definitions/modules/embed.js +3 -3
- package/src/definitions/modules/flyout.js +25 -23
- package/src/definitions/modules/modal.js +29 -27
- package/src/definitions/modules/nag.js +5 -5
- package/src/definitions/modules/popup.js +8 -8
- package/src/definitions/modules/progress.js +7 -7
- package/src/definitions/modules/rating.js +3 -3
- package/src/definitions/modules/search.js +11 -11
- package/src/definitions/modules/shape.js +4 -4
- package/src/definitions/modules/sidebar.js +8 -8
- package/src/definitions/modules/slider.js +17 -12
- package/src/definitions/modules/sticky.js +9 -8
- package/src/definitions/modules/tab.js +10 -10
- package/src/definitions/modules/toast.js +27 -24
- package/src/definitions/modules/transition.js +3 -3
@@ -12,9 +12,9 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
15
|
+
function isFunction(obj) {
|
16
16
|
return typeof obj === "function" && typeof obj.nodeType !== "number";
|
17
|
-
}
|
17
|
+
}
|
18
18
|
|
19
19
|
window = (typeof window != 'undefined' && window.Math == Math)
|
20
20
|
? window
|
@@ -428,8 +428,11 @@ $.fn.dropdown = function(parameters) {
|
|
428
428
|
if($input.is('[required]')) {
|
429
429
|
settings.forceSelection = true;
|
430
430
|
}
|
431
|
+
if(!settings.allowTab) {
|
432
|
+
$input.removeAttr('tabindex');
|
433
|
+
}
|
431
434
|
$input
|
432
|
-
.
|
435
|
+
.prop('required',false)
|
433
436
|
.removeAttr('class')
|
434
437
|
.detach()
|
435
438
|
.prependTo($module)
|
@@ -523,7 +526,7 @@ $.fn.dropdown = function(parameters) {
|
|
523
526
|
},
|
524
527
|
|
525
528
|
show: function(callback, preventFocus) {
|
526
|
-
callback =
|
529
|
+
callback = isFunction(callback)
|
527
530
|
? callback
|
528
531
|
: function(){}
|
529
532
|
;
|
@@ -557,7 +560,7 @@ $.fn.dropdown = function(parameters) {
|
|
557
560
|
},
|
558
561
|
|
559
562
|
hide: function(callback, preventBlur) {
|
560
|
-
callback =
|
563
|
+
callback = isFunction(callback)
|
561
564
|
? callback
|
562
565
|
: function(){}
|
563
566
|
;
|
@@ -568,7 +571,7 @@ $.fn.dropdown = function(parameters) {
|
|
568
571
|
module.remove.visible();
|
569
572
|
// hiding search focus
|
570
573
|
if ( module.is.focusedOnSearch() && preventBlur !== true ) {
|
571
|
-
$search.blur
|
574
|
+
$search.trigger('blur');
|
572
575
|
}
|
573
576
|
callback.call(element);
|
574
577
|
});
|
@@ -955,9 +958,9 @@ $.fn.dropdown = function(parameters) {
|
|
955
958
|
.filter(function() {
|
956
959
|
// First find the last divider in this divider group
|
957
960
|
// Dividers which are direct siblings are considered a group
|
958
|
-
var lastDivider = $(this).nextUntil(selector.item);
|
961
|
+
var $lastDivider = $(this).nextUntil(selector.item);
|
959
962
|
|
960
|
-
return (lastDivider.length ? lastDivider : $(this))
|
963
|
+
return ($lastDivider.length ? $lastDivider : $(this))
|
961
964
|
// Count all non-filtered items until the next divider (or end of the dropdown)
|
962
965
|
.nextUntil(selector.divider)
|
963
966
|
.filter(selector.item + ":not(." + className.filtered + ")")
|
@@ -1012,18 +1015,18 @@ $.fn.dropdown = function(parameters) {
|
|
1012
1015
|
if( module.has.search() && !module.is.focusedOnSearch() ) {
|
1013
1016
|
if(skipHandler) {
|
1014
1017
|
$module.off('focus' + eventNamespace, selector.search);
|
1015
|
-
$search.focus
|
1018
|
+
$search.trigger('focus');
|
1016
1019
|
$module.on('focus' + eventNamespace, selector.search, module.event.search.focus);
|
1017
1020
|
}
|
1018
1021
|
else {
|
1019
|
-
$search.focus
|
1022
|
+
$search.trigger('focus');
|
1020
1023
|
}
|
1021
1024
|
}
|
1022
1025
|
},
|
1023
1026
|
|
1024
1027
|
blurSearch: function() {
|
1025
1028
|
if( module.has.search() ) {
|
1026
|
-
$search.blur
|
1029
|
+
$search.trigger('blur');
|
1027
1030
|
}
|
1028
1031
|
},
|
1029
1032
|
|
@@ -1384,7 +1387,7 @@ $.fn.dropdown = function(parameters) {
|
|
1384
1387
|
;
|
1385
1388
|
// prevents IE11 bug where menu receives focus even though `tabindex=-1`
|
1386
1389
|
if (document.activeElement.tagName.toLowerCase() !== 'input') {
|
1387
|
-
$(document.activeElement).blur
|
1390
|
+
$(document.activeElement).trigger('blur');
|
1388
1391
|
}
|
1389
1392
|
if(!isBubbledEvent && (!hasSubMenu || settings.allowCategorySelection)) {
|
1390
1393
|
if(module.is.searchSelection()) {
|
@@ -1585,7 +1588,7 @@ $.fn.dropdown = function(parameters) {
|
|
1585
1588
|
if(module.is.searchSelection()) {
|
1586
1589
|
module.remove.searchTerm();
|
1587
1590
|
if(module.is.multiple()) {
|
1588
|
-
$search.focus
|
1591
|
+
$search.trigger('focus');
|
1589
1592
|
}
|
1590
1593
|
}
|
1591
1594
|
}
|
@@ -1741,11 +1744,11 @@ $.fn.dropdown = function(parameters) {
|
|
1741
1744
|
selectAction: function(text, value) {
|
1742
1745
|
selectActionActive = true;
|
1743
1746
|
module.verbose('Determining action', settings.action);
|
1744
|
-
if(
|
1747
|
+
if( isFunction( module.action[settings.action] ) ) {
|
1745
1748
|
module.verbose('Triggering preset action', settings.action, text, value);
|
1746
1749
|
module.action[ settings.action ].call(element, text, value, this);
|
1747
1750
|
}
|
1748
|
-
else if(
|
1751
|
+
else if( isFunction(settings.action) ) {
|
1749
1752
|
module.verbose('Triggering user action', settings.action, text, value);
|
1750
1753
|
settings.action.call(element, text, value, this);
|
1751
1754
|
}
|
@@ -1760,7 +1763,7 @@ $.fn.dropdown = function(parameters) {
|
|
1760
1763
|
inDocument = ($target.closest(document.documentElement).length > 0),
|
1761
1764
|
inModule = ($target.closest($module).length > 0)
|
1762
1765
|
;
|
1763
|
-
callback =
|
1766
|
+
callback = isFunction(callback)
|
1764
1767
|
? callback
|
1765
1768
|
: function(){}
|
1766
1769
|
;
|
@@ -1782,7 +1785,7 @@ $.fn.dropdown = function(parameters) {
|
|
1782
1785
|
notOnLabel = ($module.find($label).length === 0 || !(module.is.multiple() && settings.useLabels)),
|
1783
1786
|
notInMenu = ($target.closest($menu).length === 0)
|
1784
1787
|
;
|
1785
|
-
callback =
|
1788
|
+
callback = isFunction(callback)
|
1786
1789
|
? callback
|
1787
1790
|
: function(){}
|
1788
1791
|
;
|
@@ -2097,7 +2100,7 @@ $.fn.dropdown = function(parameters) {
|
|
2097
2100
|
values.sort(function(a, b) {
|
2098
2101
|
return (a.name.toLowerCase().localeCompare(b.name.toLowerCase()));
|
2099
2102
|
});
|
2100
|
-
} else if(
|
2103
|
+
} else if(isFunction(settings.sortSelect)) {
|
2101
2104
|
values.sort(settings.sortSelect);
|
2102
2105
|
}
|
2103
2106
|
select[fields.values] = values;
|
@@ -2469,7 +2472,7 @@ $.fn.dropdown = function(parameters) {
|
|
2469
2472
|
;
|
2470
2473
|
if(isMultiple && hasSearchValue) {
|
2471
2474
|
module.verbose('Adjusting input width', searchWidth, settings.glyphWidth);
|
2472
|
-
$search.css('width', searchWidth);
|
2475
|
+
$search.css('width', searchWidth + 'px');
|
2473
2476
|
}
|
2474
2477
|
if(hasSearchValue || (isSearchMultiple && valueIsSet)) {
|
2475
2478
|
module.verbose('Hiding placeholder text');
|
@@ -2507,13 +2510,14 @@ $.fn.dropdown = function(parameters) {
|
|
2507
2510
|
module.debug('Added tabindex to dropdown');
|
2508
2511
|
if( $module.attr('tabindex') === undefined) {
|
2509
2512
|
$module
|
2510
|
-
.attr('tabindex', 0)
|
2513
|
+
.attr('tabindex', $input.attr('tabindex') || 0)
|
2511
2514
|
;
|
2512
2515
|
$menu
|
2513
2516
|
.attr('tabindex', -1)
|
2514
2517
|
;
|
2515
2518
|
}
|
2516
2519
|
}
|
2520
|
+
$input.removeAttr('tabindex');
|
2517
2521
|
},
|
2518
2522
|
initialLoad: function() {
|
2519
2523
|
module.verbose('Setting initial load');
|
@@ -3650,7 +3654,7 @@ $.fn.dropdown = function(parameters) {
|
|
3650
3654
|
},
|
3651
3655
|
transition
|
3652
3656
|
;
|
3653
|
-
callback =
|
3657
|
+
callback = isFunction(callback)
|
3654
3658
|
? callback
|
3655
3659
|
: function(){}
|
3656
3660
|
;
|
@@ -3701,7 +3705,7 @@ $.fn.dropdown = function(parameters) {
|
|
3701
3705
|
},
|
3702
3706
|
transition = settings.transition.hideMethod || module.get.transition($subMenu)
|
3703
3707
|
;
|
3704
|
-
callback =
|
3708
|
+
callback = isFunction(callback)
|
3705
3709
|
? callback
|
3706
3710
|
: function(){}
|
3707
3711
|
;
|
@@ -3959,7 +3963,7 @@ $.fn.dropdown = function(parameters) {
|
|
3959
3963
|
}
|
3960
3964
|
});
|
3961
3965
|
}
|
3962
|
-
if (
|
3966
|
+
if ( isFunction( found ) ) {
|
3963
3967
|
response = found.apply(context, passedArguments);
|
3964
3968
|
}
|
3965
3969
|
else if(found !== undefined) {
|
@@ -12,9 +12,9 @@
|
|
12
12
|
|
13
13
|
"use strict";
|
14
14
|
|
15
|
-
|
15
|
+
function isFunction(obj) {
|
16
16
|
return typeof obj === "function" && typeof obj.nodeType !== "number";
|
17
|
-
}
|
17
|
+
}
|
18
18
|
|
19
19
|
window = (typeof window != 'undefined' && window.Math == Math)
|
20
20
|
? window
|
@@ -536,7 +536,7 @@ $.fn.embed = function(parameters) {
|
|
536
536
|
}
|
537
537
|
});
|
538
538
|
}
|
539
|
-
if (
|
539
|
+
if ( isFunction( found ) ) {
|
540
540
|
response = found.apply(context, passedArguments);
|
541
541
|
}
|
542
542
|
else if(found !== undefined) {
|
@@ -12,9 +12,9 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
15
|
+
function isFunction(obj) {
|
16
16
|
return typeof obj === "function" && typeof obj.nodeType !== "number";
|
17
|
-
}
|
17
|
+
}
|
18
18
|
|
19
19
|
window = (typeof window != 'undefined' && window.Math == Math)
|
20
20
|
? window
|
@@ -105,7 +105,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
105
105
|
module.create.id();
|
106
106
|
if(!isFlyoutComponent) {
|
107
107
|
module.create.flyout();
|
108
|
-
if(
|
108
|
+
if(!isFunction(settings.onHidden)) {
|
109
109
|
settings.onHidden = function () {
|
110
110
|
module.destroy();
|
111
111
|
$module.remove();
|
@@ -134,17 +134,19 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
134
134
|
icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
135
135
|
text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
|
136
136
|
cls = module.helpers.deQuote(el[fields.class] || ''),
|
137
|
-
click = el[fields.click] &&
|
137
|
+
click = el[fields.click] && isFunction(el[fields.click]) ? el[fields.click] : function () {}
|
138
138
|
;
|
139
139
|
$actions.append($('<button/>', {
|
140
140
|
html: icon + text,
|
141
141
|
'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g,''),
|
142
142
|
class: className.button + ' ' + cls,
|
143
|
-
|
144
|
-
|
145
|
-
|
143
|
+
on: {
|
144
|
+
click: function () {
|
145
|
+
if (click.call(element, $module) === false) {
|
146
|
+
return;
|
147
|
+
}
|
148
|
+
module.hide();
|
146
149
|
}
|
147
|
-
module.hide();
|
148
150
|
}
|
149
151
|
}));
|
150
152
|
});
|
@@ -290,7 +292,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
290
292
|
keyCode = event.which
|
291
293
|
;
|
292
294
|
if (keyCode === settings.keys.tab && event.shiftKey) {
|
293
|
-
$inputs.last().focus
|
295
|
+
$inputs.last().trigger('focus');
|
294
296
|
event.preventDefault();
|
295
297
|
}
|
296
298
|
},
|
@@ -299,7 +301,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
299
301
|
keyCode = event.which
|
300
302
|
;
|
301
303
|
if (keyCode === settings.keys.tab && !event.shiftKey) {
|
302
|
-
$inputs.first().focus
|
304
|
+
$inputs.first().trigger('focus');
|
303
305
|
event.preventDefault();
|
304
306
|
}
|
305
307
|
}
|
@@ -579,7 +581,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
579
581
|
var
|
580
582
|
$toggle = $(selector)
|
581
583
|
;
|
582
|
-
event =
|
584
|
+
event = isFunction(module[event])
|
583
585
|
? module[event]
|
584
586
|
: module.toggle
|
585
587
|
;
|
@@ -595,7 +597,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
595
597
|
},
|
596
598
|
|
597
599
|
show: function(callback) {
|
598
|
-
callback =
|
600
|
+
callback = isFunction(callback)
|
599
601
|
? callback
|
600
602
|
: function(){}
|
601
603
|
;
|
@@ -634,7 +636,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
634
636
|
},
|
635
637
|
|
636
638
|
hide: function(callback) {
|
637
|
-
callback =
|
639
|
+
callback = isFunction(callback)
|
638
640
|
? callback
|
639
641
|
: function(){}
|
640
642
|
;
|
@@ -648,7 +650,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
648
650
|
module.refreshFlyouts();
|
649
651
|
module.pullPage(function() {
|
650
652
|
callback.call(element);
|
651
|
-
if(
|
653
|
+
if(isFunction(settings.onHidden)) {
|
652
654
|
settings.onHidden.call(element);
|
653
655
|
}
|
654
656
|
module.restore.focus();
|
@@ -700,7 +702,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
700
702
|
dim,
|
701
703
|
transitionEnd
|
702
704
|
;
|
703
|
-
callback =
|
705
|
+
callback = isFunction(callback)
|
704
706
|
? callback
|
705
707
|
: function(){}
|
706
708
|
;
|
@@ -738,7 +740,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
738
740
|
animate,
|
739
741
|
transitionEnd
|
740
742
|
;
|
741
|
-
callback =
|
743
|
+
callback = isFunction(callback)
|
742
744
|
? callback
|
743
745
|
: function(){}
|
744
746
|
;
|
@@ -809,7 +811,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
809
811
|
: ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
|
810
812
|
;
|
811
813
|
if($input.length > 0) {
|
812
|
-
$input.focus
|
814
|
+
$input.trigger('focus');
|
813
815
|
}
|
814
816
|
},
|
815
817
|
dimmerStyles: function() {
|
@@ -978,7 +980,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
978
980
|
inCurrentFlyout = $activeElement.closest($module).length > 0
|
979
981
|
;
|
980
982
|
if(!inCurrentFlyout) {
|
981
|
-
$focusedElement = $(document.activeElement).blur
|
983
|
+
$focusedElement = $(document.activeElement).trigger('blur');
|
982
984
|
}
|
983
985
|
},
|
984
986
|
bodyMargin: function() {
|
@@ -1078,7 +1080,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
1078
1080
|
restore: {
|
1079
1081
|
focus: function() {
|
1080
1082
|
if($focusedElement && $focusedElement.length > 0 && settings.restoreFocus) {
|
1081
|
-
$focusedElement.focus
|
1083
|
+
$focusedElement.trigger('focus');
|
1082
1084
|
}
|
1083
1085
|
},
|
1084
1086
|
bodyMargin: function() {
|
@@ -1267,7 +1269,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
1267
1269
|
}
|
1268
1270
|
});
|
1269
1271
|
}
|
1270
|
-
if (
|
1272
|
+
if ( isFunction( found ) ) {
|
1271
1273
|
response = found.apply(context, passedArguments);
|
1272
1274
|
}
|
1273
1275
|
else if(found !== undefined) {
|
@@ -1289,7 +1291,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
1289
1291
|
|
1290
1292
|
if(methodInvoked) {
|
1291
1293
|
if(instance === undefined) {
|
1292
|
-
if (
|
1294
|
+
if (isFunction(settings.templates[query])) {
|
1293
1295
|
settings.autoShow = true;
|
1294
1296
|
settings.className.flyout = settings.className.template;
|
1295
1297
|
settings = $.extend(true, {}, settings, settings.templates[query].apply(module ,queryArguments));
|
@@ -1302,7 +1304,7 @@ $.flyout = $.fn.flyout = function(parameters) {
|
|
1302
1304
|
}
|
1303
1305
|
module.initialize();
|
1304
1306
|
}
|
1305
|
-
if (
|
1307
|
+
if (!isFunction(settings.templates[query])) {
|
1306
1308
|
module.invoke(query);
|
1307
1309
|
}
|
1308
1310
|
}
|
@@ -1452,7 +1454,7 @@ $.fn.flyout.settings.templates = {
|
|
1452
1454
|
title: ''
|
1453
1455
|
}, queryArguments[0]);
|
1454
1456
|
} else {
|
1455
|
-
if(
|
1457
|
+
if(!isFunction(queryArguments[queryArguments.length-1])) {
|
1456
1458
|
queryArguments.push(function() {});
|
1457
1459
|
}
|
1458
1460
|
return {
|
@@ -12,9 +12,9 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
15
|
+
function isFunction(obj) {
|
16
16
|
return typeof obj === "function" && typeof obj.nodeType !== "number";
|
17
|
-
}
|
17
|
+
}
|
18
18
|
|
19
19
|
window = (typeof window != 'undefined' && window.Math == Math)
|
20
20
|
? window
|
@@ -101,7 +101,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
101
101
|
module.create.id();
|
102
102
|
if(!isModalComponent) {
|
103
103
|
module.create.modal();
|
104
|
-
if(
|
104
|
+
if(!isFunction(settings.onHidden)) {
|
105
105
|
settings.onHidden = function () {
|
106
106
|
module.destroy();
|
107
107
|
$module.remove();
|
@@ -126,17 +126,19 @@ $.modal = $.fn.modal = function(parameters) {
|
|
126
126
|
var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
127
127
|
text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
|
128
128
|
cls = module.helpers.deQuote(el[fields.class] || ''),
|
129
|
-
click = el[fields.click] &&
|
129
|
+
click = el[fields.click] && isFunction(el[fields.click]) ? el[fields.click] : function () {};
|
130
130
|
$actions.append($('<button/>', {
|
131
131
|
html: icon + text,
|
132
132
|
'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g,''),
|
133
133
|
class: className.button + ' ' + cls,
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
134
|
+
on: {
|
135
|
+
click: function () {
|
136
|
+
var button = $(this);
|
137
|
+
if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
|
138
|
+
return;
|
139
|
+
}
|
140
|
+
module.hide();
|
138
141
|
}
|
139
|
-
module.hide();
|
140
142
|
}
|
141
143
|
}));
|
142
144
|
});
|
@@ -299,7 +301,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
299
301
|
var
|
300
302
|
$toggle = $(selector)
|
301
303
|
;
|
302
|
-
event =
|
304
|
+
event = isFunction(module[event])
|
303
305
|
? module[event]
|
304
306
|
: module.toggle
|
305
307
|
;
|
@@ -397,7 +399,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
397
399
|
keyCode = event.which
|
398
400
|
;
|
399
401
|
if (keyCode === settings.keys.tab && event.shiftKey) {
|
400
|
-
$inputs.last().focus
|
402
|
+
$inputs.last().trigger('focus');
|
401
403
|
event.preventDefault();
|
402
404
|
}
|
403
405
|
},
|
@@ -406,7 +408,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
406
408
|
keyCode = event.which
|
407
409
|
;
|
408
410
|
if (keyCode === settings.keys.tab && !event.shiftKey) {
|
409
|
-
$inputs.first().focus
|
411
|
+
$inputs.first().trigger('focus');
|
410
412
|
event.preventDefault();
|
411
413
|
}
|
412
414
|
}
|
@@ -494,7 +496,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
494
496
|
},
|
495
497
|
|
496
498
|
show: function(callback) {
|
497
|
-
callback =
|
499
|
+
callback = isFunction(callback)
|
498
500
|
? callback
|
499
501
|
: function(){}
|
500
502
|
;
|
@@ -506,7 +508,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
506
508
|
},
|
507
509
|
|
508
510
|
hide: function(callback) {
|
509
|
-
callback =
|
511
|
+
callback = isFunction(callback)
|
510
512
|
? callback
|
511
513
|
: function(){}
|
512
514
|
;
|
@@ -515,7 +517,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
515
517
|
},
|
516
518
|
|
517
519
|
showModal: function(callback) {
|
518
|
-
callback =
|
520
|
+
callback = isFunction(callback)
|
519
521
|
? callback
|
520
522
|
: function(){}
|
521
523
|
;
|
@@ -597,7 +599,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
597
599
|
var
|
598
600
|
$previousModal = $otherModals.filter('.' + className.active).last()
|
599
601
|
;
|
600
|
-
callback =
|
602
|
+
callback = isFunction(callback)
|
601
603
|
? callback
|
602
604
|
: function(){}
|
603
605
|
;
|
@@ -641,7 +643,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
641
643
|
$previousModal.find(selector.dimmer).removeClass('active');
|
642
644
|
}
|
643
645
|
}
|
644
|
-
if(
|
646
|
+
if(isFunction(settings.onHidden)) {
|
645
647
|
settings.onHidden.call(element);
|
646
648
|
}
|
647
649
|
module.remove.dimmerStyles();
|
@@ -693,7 +695,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
693
695
|
var
|
694
696
|
$visibleModals = $allModals.filter('.' + className.active + ', .' + className.animating)
|
695
697
|
;
|
696
|
-
callback =
|
698
|
+
callback = isFunction(callback)
|
697
699
|
? callback
|
698
700
|
: function(){}
|
699
701
|
;
|
@@ -717,7 +719,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
717
719
|
var
|
718
720
|
$visibleModals = $otherModals.filter('.' + className.active + ', .' + className.animating)
|
719
721
|
;
|
720
|
-
callback =
|
722
|
+
callback = isFunction(callback)
|
721
723
|
? callback
|
722
724
|
: function(){}
|
723
725
|
;
|
@@ -755,7 +757,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
755
757
|
inCurrentModal = $activeElement.closest($module).length > 0
|
756
758
|
;
|
757
759
|
if(!inCurrentModal) {
|
758
|
-
$focusedElement = $(document.activeElement).blur
|
760
|
+
$focusedElement = $(document.activeElement).trigger('blur');
|
759
761
|
}
|
760
762
|
},
|
761
763
|
bodyMargin: function() {
|
@@ -769,7 +771,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
769
771
|
restore: {
|
770
772
|
focus: function() {
|
771
773
|
if($focusedElement && $focusedElement.length > 0 && settings.restoreFocus) {
|
772
|
-
$focusedElement.focus
|
774
|
+
$focusedElement.trigger('focus');
|
773
775
|
}
|
774
776
|
},
|
775
777
|
bodyMargin: function() {
|
@@ -993,7 +995,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
993
995
|
: ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
|
994
996
|
;
|
995
997
|
if($input.length > 0) {
|
996
|
-
$input.focus
|
998
|
+
$input.trigger('focus');
|
997
999
|
}
|
998
1000
|
},
|
999
1001
|
bodyMargin: function() {
|
@@ -1093,7 +1095,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
1093
1095
|
else if(!$module.hasClass('bottom')) {
|
1094
1096
|
module.debug('Modal is taller than page content, resizing page height');
|
1095
1097
|
$context
|
1096
|
-
.css('height', module.cache.height + (settings.padding * 2) )
|
1098
|
+
.css('height', module.cache.height + (settings.padding * 2) + 'px')
|
1097
1099
|
;
|
1098
1100
|
}
|
1099
1101
|
},
|
@@ -1272,7 +1274,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
1272
1274
|
}
|
1273
1275
|
});
|
1274
1276
|
}
|
1275
|
-
if (
|
1277
|
+
if ( isFunction( found ) ) {
|
1276
1278
|
response = found.apply(context, passedArguments);
|
1277
1279
|
}
|
1278
1280
|
else if(found !== undefined) {
|
@@ -1293,7 +1295,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
1293
1295
|
|
1294
1296
|
if(methodInvoked) {
|
1295
1297
|
if(instance === undefined) {
|
1296
|
-
if (
|
1298
|
+
if (isFunction(settings.templates[query])) {
|
1297
1299
|
settings.autoShow = true;
|
1298
1300
|
settings.className.modal = settings.className.template;
|
1299
1301
|
settings = $.extend(true, {}, settings, settings.templates[query].apply(module ,queryArguments));
|
@@ -1306,7 +1308,7 @@ $.modal = $.fn.modal = function(parameters) {
|
|
1306
1308
|
}
|
1307
1309
|
module.initialize();
|
1308
1310
|
}
|
1309
|
-
if (
|
1311
|
+
if (!isFunction(settings.templates[query])) {
|
1310
1312
|
module.invoke(query);
|
1311
1313
|
}
|
1312
1314
|
}
|
@@ -1471,7 +1473,7 @@ $.fn.modal.settings.templates = {
|
|
1471
1473
|
title: ''
|
1472
1474
|
}, queryArguments[0]);
|
1473
1475
|
} else {
|
1474
|
-
if(
|
1476
|
+
if(!isFunction(queryArguments[queryArguments.length-1])) {
|
1475
1477
|
queryArguments.push(function() {});
|
1476
1478
|
}
|
1477
1479
|
return {
|
@@ -12,9 +12,9 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
15
|
+
function isFunction(obj) {
|
16
16
|
return typeof obj === "function" && typeof obj.nodeType !== "number";
|
17
|
-
}
|
17
|
+
}
|
18
18
|
|
19
19
|
window = (typeof window != 'undefined' && window.Math == Math)
|
20
20
|
? window
|
@@ -435,7 +435,7 @@ $.fn.nag = function(parameters) {
|
|
435
435
|
}
|
436
436
|
});
|
437
437
|
}
|
438
|
-
if (
|
438
|
+
if ( isFunction( found ) ) {
|
439
439
|
response = found.apply(context, passedArguments);
|
440
440
|
}
|
441
441
|
else if(found !== undefined) {
|
@@ -553,8 +553,8 @@ $.fn.nag.settings = {
|
|
553
553
|
|
554
554
|
// Adds easing
|
555
555
|
$.extend( $.easing, {
|
556
|
-
easeOutQuad: function (x
|
557
|
-
return -
|
556
|
+
easeOutQuad: function (x) {
|
557
|
+
return 1 - (1 - x) * (1 - x);
|
558
558
|
}
|
559
559
|
});
|
560
560
|
|
@@ -12,9 +12,9 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
15
|
+
function isFunction(obj) {
|
16
16
|
return typeof obj === "function" && typeof obj.nodeType !== "number";
|
17
|
-
}
|
17
|
+
}
|
18
18
|
|
19
19
|
window = (typeof window != 'undefined' && window.Math == Math)
|
20
20
|
? window
|
@@ -429,7 +429,7 @@ $.fn.popup = function(parameters) {
|
|
429
429
|
},
|
430
430
|
animate: {
|
431
431
|
show: function(callback) {
|
432
|
-
callback =
|
432
|
+
callback = isFunction(callback) ? callback : function(){};
|
433
433
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
434
434
|
module.set.visible();
|
435
435
|
$popup
|
@@ -453,7 +453,7 @@ $.fn.popup = function(parameters) {
|
|
453
453
|
}
|
454
454
|
},
|
455
455
|
hide: function(callback) {
|
456
|
-
callback =
|
456
|
+
callback = isFunction(callback) ? callback : function(){};
|
457
457
|
module.debug('Hiding pop-up');
|
458
458
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
459
459
|
$popup
|
@@ -511,16 +511,16 @@ $.fn.popup = function(parameters) {
|
|
511
511
|
var
|
512
512
|
$popupOffsetParent = module.get.offsetParent($popup),
|
513
513
|
targetElement = $target[0],
|
514
|
-
|
514
|
+
isWindowEl = ($boundary[0] == window),
|
515
515
|
targetOffset = $target.offset(),
|
516
516
|
parentOffset = settings.inline || (settings.popup && settings.movePopup)
|
517
517
|
? $target.offsetParent().offset()
|
518
518
|
: { top: 0, left: 0 },
|
519
|
-
screenPosition = (
|
519
|
+
screenPosition = (isWindowEl)
|
520
520
|
? { top: 0, left: 0 }
|
521
521
|
: $boundary.offset(),
|
522
522
|
calculations = {},
|
523
|
-
scroll = (
|
523
|
+
scroll = (isWindowEl)
|
524
524
|
? { top: $window.scrollTop(), left: $window.scrollLeft() }
|
525
525
|
: { top: 0, left: 0},
|
526
526
|
screen
|
@@ -1284,7 +1284,7 @@ $.fn.popup = function(parameters) {
|
|
1284
1284
|
}
|
1285
1285
|
});
|
1286
1286
|
}
|
1287
|
-
if (
|
1287
|
+
if ( isFunction( found ) ) {
|
1288
1288
|
response = found.apply(context, passedArguments);
|
1289
1289
|
}
|
1290
1290
|
else if(found !== undefined) {
|