fomantic-ui 2.9.1-beta.14 → 2.9.1-beta.16
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 +23 -23
- 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 +138 -8
- package/dist/components/input.min.css +2 -2
- 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 +4 -1
- package/dist/components/statistic.min.css +2 -2
- 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 +258 -57
- package/dist/semantic.js +307 -294
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +2 -2
- 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/elements/input.less +14 -5
- 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 +22 -22
- 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
- package/src/definitions/views/statistic.less +5 -0
- package/src/themes/default/globals/variation.variables +1 -0
@@ -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.dropdown = function(parameters) {
|
|
429
429
|
settings.forceSelection = true;
|
430
430
|
}
|
431
431
|
$input
|
432
|
-
.
|
432
|
+
.prop('required',false)
|
433
433
|
.removeAttr('class')
|
434
434
|
.detach()
|
435
435
|
.prependTo($module)
|
@@ -523,7 +523,7 @@ $.fn.dropdown = function(parameters) {
|
|
523
523
|
},
|
524
524
|
|
525
525
|
show: function(callback, preventFocus) {
|
526
|
-
callback =
|
526
|
+
callback = isFunction(callback)
|
527
527
|
? callback
|
528
528
|
: function(){}
|
529
529
|
;
|
@@ -557,7 +557,7 @@ $.fn.dropdown = function(parameters) {
|
|
557
557
|
},
|
558
558
|
|
559
559
|
hide: function(callback, preventBlur) {
|
560
|
-
callback =
|
560
|
+
callback = isFunction(callback)
|
561
561
|
? callback
|
562
562
|
: function(){}
|
563
563
|
;
|
@@ -568,7 +568,7 @@ $.fn.dropdown = function(parameters) {
|
|
568
568
|
module.remove.visible();
|
569
569
|
// hiding search focus
|
570
570
|
if ( module.is.focusedOnSearch() && preventBlur !== true ) {
|
571
|
-
$search.blur
|
571
|
+
$search.trigger('blur');
|
572
572
|
}
|
573
573
|
callback.call(element);
|
574
574
|
});
|
@@ -955,9 +955,9 @@ $.fn.dropdown = function(parameters) {
|
|
955
955
|
.filter(function() {
|
956
956
|
// First find the last divider in this divider group
|
957
957
|
// Dividers which are direct siblings are considered a group
|
958
|
-
var lastDivider = $(this).nextUntil(selector.item);
|
958
|
+
var $lastDivider = $(this).nextUntil(selector.item);
|
959
959
|
|
960
|
-
return (lastDivider.length ? lastDivider : $(this))
|
960
|
+
return ($lastDivider.length ? $lastDivider : $(this))
|
961
961
|
// Count all non-filtered items until the next divider (or end of the dropdown)
|
962
962
|
.nextUntil(selector.divider)
|
963
963
|
.filter(selector.item + ":not(." + className.filtered + ")")
|
@@ -1012,18 +1012,18 @@ $.fn.dropdown = function(parameters) {
|
|
1012
1012
|
if( module.has.search() && !module.is.focusedOnSearch() ) {
|
1013
1013
|
if(skipHandler) {
|
1014
1014
|
$module.off('focus' + eventNamespace, selector.search);
|
1015
|
-
$search.focus
|
1015
|
+
$search.trigger('focus');
|
1016
1016
|
$module.on('focus' + eventNamespace, selector.search, module.event.search.focus);
|
1017
1017
|
}
|
1018
1018
|
else {
|
1019
|
-
$search.focus
|
1019
|
+
$search.trigger('focus');
|
1020
1020
|
}
|
1021
1021
|
}
|
1022
1022
|
},
|
1023
1023
|
|
1024
1024
|
blurSearch: function() {
|
1025
1025
|
if( module.has.search() ) {
|
1026
|
-
$search.blur
|
1026
|
+
$search.trigger('blur');
|
1027
1027
|
}
|
1028
1028
|
},
|
1029
1029
|
|
@@ -1384,7 +1384,7 @@ $.fn.dropdown = function(parameters) {
|
|
1384
1384
|
;
|
1385
1385
|
// prevents IE11 bug where menu receives focus even though `tabindex=-1`
|
1386
1386
|
if (document.activeElement.tagName.toLowerCase() !== 'input') {
|
1387
|
-
$(document.activeElement).blur
|
1387
|
+
$(document.activeElement).trigger('blur');
|
1388
1388
|
}
|
1389
1389
|
if(!isBubbledEvent && (!hasSubMenu || settings.allowCategorySelection)) {
|
1390
1390
|
if(module.is.searchSelection()) {
|
@@ -1585,7 +1585,7 @@ $.fn.dropdown = function(parameters) {
|
|
1585
1585
|
if(module.is.searchSelection()) {
|
1586
1586
|
module.remove.searchTerm();
|
1587
1587
|
if(module.is.multiple()) {
|
1588
|
-
$search.focus
|
1588
|
+
$search.trigger('focus');
|
1589
1589
|
}
|
1590
1590
|
}
|
1591
1591
|
}
|
@@ -1741,11 +1741,11 @@ $.fn.dropdown = function(parameters) {
|
|
1741
1741
|
selectAction: function(text, value) {
|
1742
1742
|
selectActionActive = true;
|
1743
1743
|
module.verbose('Determining action', settings.action);
|
1744
|
-
if(
|
1744
|
+
if( isFunction( module.action[settings.action] ) ) {
|
1745
1745
|
module.verbose('Triggering preset action', settings.action, text, value);
|
1746
1746
|
module.action[ settings.action ].call(element, text, value, this);
|
1747
1747
|
}
|
1748
|
-
else if(
|
1748
|
+
else if( isFunction(settings.action) ) {
|
1749
1749
|
module.verbose('Triggering user action', settings.action, text, value);
|
1750
1750
|
settings.action.call(element, text, value, this);
|
1751
1751
|
}
|
@@ -1760,7 +1760,7 @@ $.fn.dropdown = function(parameters) {
|
|
1760
1760
|
inDocument = ($target.closest(document.documentElement).length > 0),
|
1761
1761
|
inModule = ($target.closest($module).length > 0)
|
1762
1762
|
;
|
1763
|
-
callback =
|
1763
|
+
callback = isFunction(callback)
|
1764
1764
|
? callback
|
1765
1765
|
: function(){}
|
1766
1766
|
;
|
@@ -1782,7 +1782,7 @@ $.fn.dropdown = function(parameters) {
|
|
1782
1782
|
notOnLabel = ($module.find($label).length === 0 || !(module.is.multiple() && settings.useLabels)),
|
1783
1783
|
notInMenu = ($target.closest($menu).length === 0)
|
1784
1784
|
;
|
1785
|
-
callback =
|
1785
|
+
callback = isFunction(callback)
|
1786
1786
|
? callback
|
1787
1787
|
: function(){}
|
1788
1788
|
;
|
@@ -2097,7 +2097,7 @@ $.fn.dropdown = function(parameters) {
|
|
2097
2097
|
values.sort(function(a, b) {
|
2098
2098
|
return (a.name.toLowerCase().localeCompare(b.name.toLowerCase()));
|
2099
2099
|
});
|
2100
|
-
} else if(
|
2100
|
+
} else if(isFunction(settings.sortSelect)) {
|
2101
2101
|
values.sort(settings.sortSelect);
|
2102
2102
|
}
|
2103
2103
|
select[fields.values] = values;
|
@@ -2469,7 +2469,7 @@ $.fn.dropdown = function(parameters) {
|
|
2469
2469
|
;
|
2470
2470
|
if(isMultiple && hasSearchValue) {
|
2471
2471
|
module.verbose('Adjusting input width', searchWidth, settings.glyphWidth);
|
2472
|
-
$search.css('width', searchWidth);
|
2472
|
+
$search.css('width', searchWidth + 'px');
|
2473
2473
|
}
|
2474
2474
|
if(hasSearchValue || (isSearchMultiple && valueIsSet)) {
|
2475
2475
|
module.verbose('Hiding placeholder text');
|
@@ -3650,7 +3650,7 @@ $.fn.dropdown = function(parameters) {
|
|
3650
3650
|
},
|
3651
3651
|
transition
|
3652
3652
|
;
|
3653
|
-
callback =
|
3653
|
+
callback = isFunction(callback)
|
3654
3654
|
? callback
|
3655
3655
|
: function(){}
|
3656
3656
|
;
|
@@ -3701,7 +3701,7 @@ $.fn.dropdown = function(parameters) {
|
|
3701
3701
|
},
|
3702
3702
|
transition = settings.transition.hideMethod || module.get.transition($subMenu)
|
3703
3703
|
;
|
3704
|
-
callback =
|
3704
|
+
callback = isFunction(callback)
|
3705
3705
|
? callback
|
3706
3706
|
: function(){}
|
3707
3707
|
;
|
@@ -3959,7 +3959,7 @@ $.fn.dropdown = function(parameters) {
|
|
3959
3959
|
}
|
3960
3960
|
});
|
3961
3961
|
}
|
3962
|
-
if (
|
3962
|
+
if ( isFunction( found ) ) {
|
3963
3963
|
response = found.apply(context, passedArguments);
|
3964
3964
|
}
|
3965
3965
|
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) {
|