fomantic-ui 2.10.0-beta.8 → 2.10.0-beta.80
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/.eslintrc.js +6 -23
- package/.github/workflows/ci.yml +9 -9
- package/.github/workflows/depsreview.yml +1 -1
- package/.github/workflows/nightly.yml +7 -5
- package/.github/workflows/release.yml +2 -2
- package/.stylelintrc.js +1 -15
- package/CHANGELOG.md +5289 -2325
- package/README.md +8 -4
- package/changelog-setup.js +32 -10
- package/changelog-template.hbs +256 -251
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +62 -73
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +3 -3
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +101 -161
- package/dist/components/api.min.js +3 -3
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +5 -6
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +3 -3
- package/dist/components/calendar.js +283 -332
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +3 -3
- 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 +58 -79
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +3 -3
- 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 +2 -2
- package/dist/components/dimmer.js +39 -52
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +3 -3
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +21 -35
- package/dist/components/dropdown.js +435 -531
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +3 -3
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +55 -68
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +3 -3
- package/dist/components/emoji.css +3809 -7617
- package/dist/components/emoji.min.css +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 +149 -168
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +3 -3
- package/dist/components/form.css +3 -5
- package/dist/components/form.js +244 -269
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +3 -3
- package/dist/components/grid.css +2 -2
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +6 -6
- package/dist/components/header.min.css +2 -2
- package/dist/components/icon.css +10 -37
- package/dist/components/icon.min.css +2 -2
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +284 -12
- 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 +6 -14
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +3 -3
- package/dist/components/list.min.css +2 -2
- package/dist/components/loader.css +53 -53
- package/dist/components/loader.min.css +2 -2
- package/dist/components/menu.css +45 -60
- package/dist/components/menu.min.css +2 -2
- package/dist/components/message.css +2 -2
- package/dist/components/message.min.css +2 -2
- package/dist/components/modal.css +5 -5
- package/dist/components/modal.js +161 -170
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +3 -3
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +74 -88
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +3 -3
- package/dist/components/placeholder.css +2 -2
- package/dist/components/placeholder.min.css +2 -2
- package/dist/components/popup.css +19 -73
- package/dist/components/popup.js +105 -138
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +3 -3
- package/dist/components/progress.css +4 -13
- package/dist/components/progress.js +75 -97
- package/dist/components/progress.min.css +2 -2
- package/dist/components/progress.min.js +3 -3
- 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 +49 -61
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +3 -3
- package/dist/components/reset.css +48 -208
- package/dist/components/reset.min.css +2 -2
- package/dist/components/reveal.css +2 -5
- package/dist/components/reveal.min.css +2 -2
- package/dist/components/search.css +2 -3
- package/dist/components/search.js +178 -198
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +3 -3
- package/dist/components/segment.css +6 -6
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +59 -69
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +3 -3
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +81 -101
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +3 -3
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +37 -58
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +3 -3
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +169 -183
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +3 -3
- package/dist/components/state.js +45 -59
- package/dist/components/state.min.js +3 -3
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +4 -4
- package/dist/components/step.min.css +2 -2
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +95 -117
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +3 -3
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +83 -115
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +3 -3
- package/dist/components/table.css +8 -8
- package/dist/components/table.min.css +2 -2
- 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 +64 -74
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +3 -3
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +61 -85
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +3 -3
- package/dist/components/visibility.js +120 -140
- package/dist/components/visibility.min.js +3 -3
- package/dist/semantic.css +4480 -8222
- package/dist/semantic.js +2881 -3485
- package/dist/semantic.min.css +3 -3
- package/dist/semantic.min.js +3 -3
- package/examples/attached.html +1 -1
- package/examples/components/menu.html +1 -1
- package/package.json +8 -5
- package/scripts/nightly-version.js +4 -4
- package/src/definitions/behaviors/api.js +100 -160
- package/src/definitions/behaviors/form.js +243 -268
- package/src/definitions/behaviors/state.js +44 -58
- package/src/definitions/behaviors/visibility.js +119 -139
- package/src/definitions/collections/breadcrumb.less +0 -1
- package/src/definitions/collections/form.less +3 -9
- package/src/definitions/collections/grid.less +1 -2
- package/src/definitions/collections/menu.less +106 -117
- package/src/definitions/collections/message.less +1 -2
- package/src/definitions/collections/table.less +7 -8
- package/src/definitions/elements/button.less +4 -6
- package/src/definitions/elements/container.less +0 -1
- package/src/definitions/elements/divider.less +1 -2
- package/src/definitions/elements/emoji.less +1 -1
- package/src/definitions/elements/flag.less +1 -1
- package/src/definitions/elements/header.less +4 -5
- package/src/definitions/elements/icon.less +10 -37
- package/src/definitions/elements/image.less +0 -1
- package/src/definitions/elements/input.less +4 -7
- package/src/definitions/elements/label.less +5 -14
- package/src/definitions/elements/list.less +2 -3
- package/src/definitions/elements/loader.less +10 -11
- package/src/definitions/elements/placeholder.less +1 -2
- package/src/definitions/elements/rail.less +0 -1
- package/src/definitions/elements/reveal.less +1 -5
- package/src/definitions/elements/segment.less +5 -6
- package/src/definitions/elements/step.less +3 -4
- package/src/definitions/elements/text.less +0 -1
- package/src/definitions/globals/reset.less +0 -1
- package/src/definitions/globals/site.js +36 -57
- package/src/definitions/globals/site.less +0 -1
- package/src/definitions/modules/accordion.js +61 -72
- package/src/definitions/modules/accordion.less +0 -1
- package/src/definitions/modules/calendar.js +282 -331
- package/src/definitions/modules/calendar.less +2 -3
- package/src/definitions/modules/checkbox.js +57 -78
- package/src/definitions/modules/checkbox.less +0 -1
- package/src/definitions/modules/dimmer.js +38 -51
- package/src/definitions/modules/dimmer.less +1 -2
- package/src/definitions/modules/dropdown.js +434 -530
- package/src/definitions/modules/dropdown.less +27 -38
- package/src/definitions/modules/embed.js +54 -67
- package/src/definitions/modules/embed.less +0 -1
- package/src/definitions/modules/flyout.js +148 -167
- package/src/definitions/modules/flyout.less +0 -1
- package/src/definitions/modules/modal.js +160 -169
- package/src/definitions/modules/modal.less +3 -4
- package/src/definitions/modules/nag.js +73 -87
- package/src/definitions/modules/nag.less +0 -1
- package/src/definitions/modules/popup.js +104 -137
- package/src/definitions/modules/popup.less +18 -73
- package/src/definitions/modules/progress.js +74 -96
- package/src/definitions/modules/progress.less +3 -13
- package/src/definitions/modules/rating.js +48 -60
- package/src/definitions/modules/rating.less +0 -1
- package/src/definitions/modules/search.js +177 -197
- package/src/definitions/modules/search.less +2 -4
- package/src/definitions/modules/shape.js +58 -68
- package/src/definitions/modules/shape.less +0 -1
- package/src/definitions/modules/sidebar.js +80 -100
- package/src/definitions/modules/sidebar.less +0 -1
- package/src/definitions/modules/slider.js +168 -182
- package/src/definitions/modules/slider.less +0 -1
- package/src/definitions/modules/sticky.js +94 -116
- package/src/definitions/modules/sticky.less +0 -1
- package/src/definitions/modules/tab.js +82 -114
- package/src/definitions/modules/tab.less +0 -1
- package/src/definitions/modules/toast.js +63 -73
- package/src/definitions/modules/toast.less +0 -1
- package/src/definitions/modules/transition.js +60 -84
- package/src/definitions/modules/transition.less +1 -2
- package/src/definitions/views/ad.less +0 -1
- package/src/definitions/views/card.less +0 -1
- package/src/definitions/views/comment.less +0 -1
- package/src/definitions/views/feed.less +0 -1
- package/src/definitions/views/item.less +0 -1
- package/src/definitions/views/statistic.less +0 -1
- package/src/semantic.less +1 -1
- package/src/themes/amazon/elements/button.overrides +1 -1
- package/src/themes/amazon/elements/button.variables +5 -6
- package/src/themes/amazon/globals/site.variables +2 -3
- package/src/themes/bookish/elements/header.variables +2 -2
- package/src/themes/bootstrap3/elements/button.variables +4 -5
- package/src/themes/chubby/collections/menu.variables +1 -1
- package/src/themes/chubby/elements/button.overrides +4 -4
- package/src/themes/chubby/modules/accordion.overrides +1 -1
- package/src/themes/chubby/views/comment.overrides +2 -2
- package/src/themes/chubby/views/comment.variables +2 -2
- package/src/themes/classic/collections/table.variables +2 -2
- package/src/themes/classic/elements/button.variables +11 -11
- package/src/themes/classic/modules/progress.variables +2 -2
- package/src/themes/classic/views/card.variables +2 -2
- package/src/themes/default/collections/form.variables +2 -3
- package/src/themes/default/collections/menu.variables +28 -28
- package/src/themes/default/collections/message.variables +1 -1
- package/src/themes/default/collections/table.variables +4 -4
- package/src/themes/default/elements/button.variables +9 -10
- package/src/themes/default/elements/divider.variables +1 -1
- package/src/themes/default/elements/icon.variables +2 -2
- package/src/themes/default/elements/image.variables +1 -1
- package/src/themes/default/elements/input.variables +2 -2
- package/src/themes/default/elements/label.variables +4 -4
- package/src/themes/default/elements/list.variables +1 -1
- package/src/themes/default/elements/placeholder.variables +6 -6
- package/src/themes/default/elements/segment.variables +8 -8
- package/src/themes/default/globals/reset.overrides +45 -201
- package/src/themes/default/globals/site.variables +50 -50
- package/src/themes/default/globals/variation.variables +3 -2
- package/src/themes/default/modules/accordion.variables +0 -1
- package/src/themes/default/modules/checkbox.variables +1 -1
- package/src/themes/default/modules/dimmer.variables +12 -12
- package/src/themes/default/modules/dropdown.variables +17 -16
- package/src/themes/default/modules/embed.variables +2 -2
- package/src/themes/default/modules/flyout.variables +3 -3
- package/src/themes/default/modules/modal.variables +14 -14
- package/src/themes/default/modules/nag.variables +1 -1
- package/src/themes/default/modules/rating.variables +1 -1
- package/src/themes/default/modules/search.variables +1 -1
- package/src/themes/default/modules/shape.variables +1 -1
- package/src/themes/default/modules/sidebar.variables +2 -2
- package/src/themes/default/modules/toast.variables +4 -4
- package/src/themes/default/views/card.variables +6 -7
- package/src/themes/default/views/feed.variables +4 -4
- package/src/themes/default/views/item.variables +2 -3
- package/src/themes/flat/collections/form.variables +1 -1
- package/src/themes/flat/globals/site.variables +9 -9
- package/src/themes/github/collections/form.overrides +3 -3
- package/src/themes/github/collections/form.variables +3 -3
- package/src/themes/github/collections/menu.overrides +1 -1
- package/src/themes/github/collections/menu.variables +10 -10
- package/src/themes/github/collections/message.variables +6 -6
- package/src/themes/github/elements/button.variables +17 -17
- package/src/themes/github/elements/input.variables +3 -3
- package/src/themes/github/elements/segment.variables +2 -2
- package/src/themes/github/elements/step.overrides +4 -4
- package/src/themes/github/elements/step.variables +3 -3
- package/src/themes/github/globals/site.variables +2 -2
- package/src/themes/github/modules/dropdown.variables +1 -3
- package/src/themes/gmail/collections/message.variables +2 -2
- package/src/themes/material/collections/menu.variables +1 -1
- package/src/themes/material/elements/button.overrides +4 -4
- package/src/themes/material/elements/button.variables +5 -5
- package/src/themes/material/modules/dropdown.variables +1 -1
- package/src/themes/material/modules/modal.variables +1 -1
- package/src/themes/raised/elements/button.variables +1 -1
- package/src/themes/round/elements/button.variables +12 -12
- package/src/themes/striped/modules/progress.overrides +3 -3
- package/src/themes/timeline/views/feed.variables +2 -2
- package/src/themes/twitter/elements/button.overrides +1 -1
- package/src/themes/twitter/elements/button.variables +4 -5
- package/tasks/admin/components/create.js +12 -15
- package/tasks/admin/components/init.js +11 -12
- package/tasks/admin/components/update.js +19 -20
- package/tasks/admin/distributions/create.js +30 -51
- package/tasks/admin/distributions/init.js +11 -12
- package/tasks/admin/distributions/update.js +18 -19
- package/tasks/admin/register.js +7 -7
- package/tasks/build/assets.js +1 -1
- package/tasks/build/css.js +5 -5
- package/tasks/build/javascript.js +1 -1
- package/tasks/config/admin/github.js +1 -1
- package/tasks/config/admin/templates/css-package.js +1 -1
- package/tasks/config/admin/templates/less-package.js +1 -1
- package/tasks/config/project/config.js +10 -10
- package/tasks/config/project/install.js +12 -12
- package/tasks/config/project/release.js +6 -12
- package/tasks/config/tasks.js +15 -11
- package/tasks/config/user.js +1 -4
- package/tasks/docs/metadata.js +18 -20
- package/tasks/install.js +14 -12
- package/test/meteor/assets.js +4 -4
- package/test/meteor/fonts.js +10 -11
- package/test/modules/module.spec.js +18 -18
|
@@ -19,21 +19,23 @@
|
|
|
19
19
|
? window
|
|
20
20
|
: globalThis;
|
|
21
21
|
|
|
22
|
-
$.fn.modal = function (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
$.fn.modal = function (...args) {
|
|
23
|
+
const $window = $(window);
|
|
24
|
+
const $document = $(document);
|
|
25
|
+
const $body = $('body');
|
|
26
|
+
const $allModules = isFunction(this)
|
|
27
|
+
? $body
|
|
28
|
+
: $(this);
|
|
27
29
|
|
|
28
30
|
let time = Date.now();
|
|
29
31
|
let performance = [];
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const parameters = args[0];
|
|
34
|
+
const methodInvoked = typeof parameters === 'string';
|
|
35
|
+
const queryArguments = args.slice(1);
|
|
36
|
+
const contextCheck = function (context, win) {
|
|
35
37
|
let $context;
|
|
36
|
-
if ([window, document].
|
|
38
|
+
if ([window, document].includes(context)) {
|
|
37
39
|
$context = $body;
|
|
38
40
|
} else {
|
|
39
41
|
$context = $(win.document).find(context);
|
|
@@ -51,18 +53,18 @@
|
|
|
51
53
|
? $.extend(true, {}, $.fn.modal.settings, parameters)
|
|
52
54
|
: $.extend({}, $.fn.modal.settings);
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
const selector = settings.selector;
|
|
55
57
|
let className = settings.className;
|
|
56
58
|
let namespace = settings.namespace;
|
|
57
59
|
let fields = settings.fields;
|
|
58
60
|
let error = settings.error;
|
|
59
61
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
const eventNamespace = '.' + namespace;
|
|
63
|
+
const moduleNamespace = 'module-' + namespace;
|
|
62
64
|
|
|
63
65
|
let $module = $(this);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
const $context = contextCheck(settings.context, window);
|
|
67
|
+
const isBody = $context[0] === $body[0];
|
|
66
68
|
let $closeIcon = $module.find(selector.closeIcon);
|
|
67
69
|
let $inputs;
|
|
68
70
|
|
|
@@ -72,7 +74,7 @@
|
|
|
72
74
|
let $dimmable;
|
|
73
75
|
let $dimmer;
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
const isModalComponent = $module.hasClass('modal');
|
|
76
78
|
|
|
77
79
|
let element = this;
|
|
78
80
|
let instance = isModalComponent ? $module.data(moduleNamespace) : undefined;
|
|
@@ -82,7 +84,8 @@
|
|
|
82
84
|
let initialMouseDownInModal;
|
|
83
85
|
let initialMouseDownInScrollbar;
|
|
84
86
|
let initialBodyMargin = '';
|
|
85
|
-
let
|
|
87
|
+
let initialBodyMarginInt = 0;
|
|
88
|
+
let tempBodyMargin = 0;
|
|
86
89
|
let keepScrollingClass = false;
|
|
87
90
|
let hadScrollbar = false;
|
|
88
91
|
let windowRefocused = false;
|
|
@@ -91,8 +94,7 @@
|
|
|
91
94
|
let id;
|
|
92
95
|
let observer;
|
|
93
96
|
let observeAttributes = false;
|
|
94
|
-
|
|
95
|
-
module = {
|
|
97
|
+
const module = {
|
|
96
98
|
|
|
97
99
|
initialize: function () {
|
|
98
100
|
module.create.id();
|
|
@@ -119,30 +121,32 @@
|
|
|
119
121
|
} else {
|
|
120
122
|
$actions.empty();
|
|
121
123
|
}
|
|
122
|
-
settings.actions
|
|
123
|
-
|
|
124
|
+
for (const el of settings.actions) {
|
|
125
|
+
const icon = el[fields.icon]
|
|
124
126
|
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '') + ' class="' + module.helpers.escape(el[fields.icon]) + ' icon"></i>'
|
|
125
127
|
: '';
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
const text = module.helpers.escape(el[fields.text] || '', settings);
|
|
129
|
+
const cls = module.helpers.escape(el[fields.class] || '');
|
|
130
|
+
const click = el[fields.click] && isFunction(el[fields.click])
|
|
129
131
|
? el[fields.click]
|
|
130
132
|
: function () {};
|
|
133
|
+
const elementRef = element;
|
|
134
|
+
const $moduleRef = $module;
|
|
131
135
|
$actions.append($('<button/>', {
|
|
132
136
|
html: icon + text,
|
|
133
137
|
'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g, ''),
|
|
134
138
|
class: className.button + ' ' + cls,
|
|
135
139
|
on: {
|
|
136
140
|
click: function () {
|
|
137
|
-
|
|
138
|
-
if (button.is(selector.approve) || button.is(selector.deny) || click.call(
|
|
141
|
+
const button = $(this);
|
|
142
|
+
if (button.is(selector.approve) || button.is(selector.deny) || click.call(elementRef, $moduleRef) === false) {
|
|
139
143
|
return;
|
|
140
144
|
}
|
|
141
145
|
module.hide();
|
|
142
146
|
},
|
|
143
147
|
},
|
|
144
148
|
}));
|
|
145
|
-
}
|
|
149
|
+
}
|
|
146
150
|
}
|
|
147
151
|
module.cache = {};
|
|
148
152
|
module.verbose('Initializing dimmer', $context);
|
|
@@ -184,12 +188,12 @@
|
|
|
184
188
|
$module.append($closeIcon);
|
|
185
189
|
}
|
|
186
190
|
if (settings.title !== '') {
|
|
187
|
-
|
|
191
|
+
const titleId = '_' + module.get.id() + 'title';
|
|
188
192
|
$module.attr('aria-labelledby', titleId);
|
|
189
193
|
$('<div/>', { class: className.title, id: titleId }).appendTo($module);
|
|
190
194
|
}
|
|
191
195
|
if (settings.content !== '') {
|
|
192
|
-
|
|
196
|
+
const descId = '_' + module.get.id() + 'desc';
|
|
193
197
|
$module.attr('aria-describedby', descId);
|
|
194
198
|
$('<div/>', { class: className.content, id: descId }).appendTo($module);
|
|
195
199
|
}
|
|
@@ -200,11 +204,11 @@
|
|
|
200
204
|
element = $module[0];
|
|
201
205
|
},
|
|
202
206
|
dimmer: function () {
|
|
203
|
-
|
|
207
|
+
const defaultSettings = {
|
|
204
208
|
debug: settings.debug,
|
|
205
209
|
dimmerName: 'modals',
|
|
206
210
|
};
|
|
207
|
-
|
|
211
|
+
const dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings);
|
|
208
212
|
if ($.fn.dimmer === undefined) {
|
|
209
213
|
module.error(error.dimmer);
|
|
210
214
|
|
|
@@ -252,58 +256,55 @@
|
|
|
252
256
|
},
|
|
253
257
|
|
|
254
258
|
observeChanges: function () {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
nodes.push(parent[c]);
|
|
262
|
-
}
|
|
259
|
+
observer = new MutationObserver(function (mutations) {
|
|
260
|
+
const collectNodes = function (parent) {
|
|
261
|
+
const nodes = [];
|
|
262
|
+
for (const c of parent) {
|
|
263
|
+
nodes.push(...collectNodes(c.childNodes), c);
|
|
264
|
+
}
|
|
263
265
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
266
|
+
return nodes;
|
|
267
|
+
};
|
|
268
|
+
let shouldRefresh = false;
|
|
269
|
+
let shouldRefreshInputs = false;
|
|
270
|
+
let ignoreAutofocus = true;
|
|
271
|
+
mutations.every(function (mutation) {
|
|
272
|
+
if (mutation.type === 'attributes') {
|
|
273
|
+
if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').filter(':visible').length > 0)) {
|
|
274
|
+
shouldRefreshInputs = true;
|
|
275
|
+
}
|
|
276
|
+
} else {
|
|
277
|
+
shouldRefresh = true;
|
|
278
|
+
// mutationobserver only provides the parent nodes,
|
|
279
|
+
// so let's collect all childs as well to find nested inputs
|
|
280
|
+
const $addedInputs = $(collectNodes(mutation.addedNodes)).filter('a[href], [tabindex], :input:enabled').filter(':visible');
|
|
281
|
+
const $removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
|
|
282
|
+
if ($addedInputs.length > 0 || $removedInputs.length > 0) {
|
|
283
|
+
shouldRefreshInputs = true;
|
|
284
|
+
if ($addedInputs.filter(':input').length > 0 || $removedInputs.filter(':input').length > 0) {
|
|
285
|
+
ignoreAutofocus = false;
|
|
285
286
|
}
|
|
286
287
|
}
|
|
287
|
-
|
|
288
|
-
return !shouldRefreshInputs;
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
if (shouldRefresh && settings.observeChanges) {
|
|
292
|
-
module.debug('DOM tree modified, refreshing');
|
|
293
|
-
module.refresh();
|
|
294
288
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
observer.observe(element, {
|
|
300
|
-
attributeFilter: ['class', 'disabled'],
|
|
301
|
-
attributes: true,
|
|
302
|
-
childList: true,
|
|
303
|
-
subtree: true,
|
|
289
|
+
|
|
290
|
+
return !shouldRefreshInputs;
|
|
304
291
|
});
|
|
305
|
-
|
|
306
|
-
|
|
292
|
+
|
|
293
|
+
if (shouldRefresh && settings.observeChanges) {
|
|
294
|
+
module.debug('DOM tree modified, refreshing');
|
|
295
|
+
module.refresh();
|
|
296
|
+
}
|
|
297
|
+
if (shouldRefreshInputs) {
|
|
298
|
+
module.refreshInputs(ignoreAutofocus);
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
observer.observe(element, {
|
|
302
|
+
attributeFilter: ['class', 'disabled'],
|
|
303
|
+
attributes: true,
|
|
304
|
+
childList: true,
|
|
305
|
+
subtree: true,
|
|
306
|
+
});
|
|
307
|
+
module.debug('Setting up mutation observer', observer);
|
|
307
308
|
},
|
|
308
309
|
|
|
309
310
|
refresh: function () {
|
|
@@ -345,7 +346,7 @@
|
|
|
345
346
|
},
|
|
346
347
|
|
|
347
348
|
attachEvents: function (selector, event) {
|
|
348
|
-
|
|
349
|
+
const $toggle = $(selector);
|
|
349
350
|
event = isFunction(module[event])
|
|
350
351
|
? module[event]
|
|
351
352
|
: module.toggle;
|
|
@@ -411,7 +412,7 @@
|
|
|
411
412
|
});
|
|
412
413
|
},
|
|
413
414
|
preventScroll: function (event) {
|
|
414
|
-
if (event.target.className.
|
|
415
|
+
if (event.target.className.includes('dimmer')) {
|
|
415
416
|
event.preventDefault();
|
|
416
417
|
}
|
|
417
418
|
},
|
|
@@ -430,21 +431,21 @@
|
|
|
430
431
|
module.hide();
|
|
431
432
|
},
|
|
432
433
|
closeKeyUp: function (event) {
|
|
433
|
-
|
|
434
|
+
const keyCode = event.which;
|
|
434
435
|
if ((keyCode === settings.keys.enter || keyCode === settings.keys.space) && $module.hasClass(className.front)) {
|
|
435
436
|
module.hide();
|
|
436
437
|
}
|
|
437
438
|
},
|
|
438
439
|
inputKeyDown: {
|
|
439
440
|
first: function (event) {
|
|
440
|
-
|
|
441
|
+
const keyCode = event.which;
|
|
441
442
|
if (keyCode === settings.keys.tab && event.shiftKey) {
|
|
442
443
|
$inputs.last().trigger('focus');
|
|
443
444
|
event.preventDefault();
|
|
444
445
|
}
|
|
445
446
|
},
|
|
446
447
|
last: function (event) {
|
|
447
|
-
|
|
448
|
+
const keyCode = event.which;
|
|
448
449
|
if (keyCode === settings.keys.tab && !event.shiftKey) {
|
|
449
450
|
$inputs.first().trigger('focus');
|
|
450
451
|
event.preventDefault();
|
|
@@ -452,8 +453,8 @@
|
|
|
452
453
|
},
|
|
453
454
|
},
|
|
454
455
|
mousedown: function (event) {
|
|
455
|
-
|
|
456
|
-
|
|
456
|
+
const $target = $(event.target);
|
|
457
|
+
const isRtl = module.is.rtl();
|
|
457
458
|
initialMouseDownInModal = $target.closest(selector.modal).length > 0;
|
|
458
459
|
if (initialMouseDownInModal) {
|
|
459
460
|
module.verbose('Mouse down event registered inside the modal');
|
|
@@ -479,9 +480,9 @@
|
|
|
479
480
|
|
|
480
481
|
return;
|
|
481
482
|
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
483
|
+
const $target = $(event.target);
|
|
484
|
+
const isInModal = $target.closest(selector.modal).length > 0;
|
|
485
|
+
const isInDOM = document.documentElement.contains(event.target);
|
|
485
486
|
if (!isInModal && isInDOM && module.is.active() && $module.hasClass(className.front)) {
|
|
486
487
|
module.debug('Dimmer clicked, hiding all modals');
|
|
487
488
|
if (settings.allowMultiple) {
|
|
@@ -501,7 +502,7 @@
|
|
|
501
502
|
}, delay);
|
|
502
503
|
},
|
|
503
504
|
keyboard: function (event) {
|
|
504
|
-
|
|
505
|
+
const keyCode = event.which;
|
|
505
506
|
if (keyCode === settings.keys.escape) {
|
|
506
507
|
if (settings.closable) {
|
|
507
508
|
module.debug('Escape key pressed hiding modal');
|
|
@@ -611,7 +612,7 @@
|
|
|
611
612
|
duration: settings.transition.showDuration || settings.duration,
|
|
612
613
|
useFailSafe: true,
|
|
613
614
|
onComplete: function () {
|
|
614
|
-
settings.onVisible.
|
|
615
|
+
settings.onVisible.call(element);
|
|
615
616
|
if (settings.keyboardShortcuts) {
|
|
616
617
|
module.add.keyboardShortcuts();
|
|
617
618
|
}
|
|
@@ -632,7 +633,7 @@
|
|
|
632
633
|
},
|
|
633
634
|
|
|
634
635
|
hideModal: function (callback, keepDimmed, hideOthersToo) {
|
|
635
|
-
|
|
636
|
+
const $previousModal = $otherModals.filter('.' + className.active).last();
|
|
636
637
|
callback = isFunction(callback)
|
|
637
638
|
? callback
|
|
638
639
|
: function () {};
|
|
@@ -721,7 +722,7 @@
|
|
|
721
722
|
},
|
|
722
723
|
|
|
723
724
|
hideAll: function (callback) {
|
|
724
|
-
|
|
725
|
+
const $visibleModals = $allModals.filter('.' + className.active + ', .' + className.animating);
|
|
725
726
|
callback = isFunction(callback)
|
|
726
727
|
? callback
|
|
727
728
|
: function () {};
|
|
@@ -743,7 +744,7 @@
|
|
|
743
744
|
},
|
|
744
745
|
|
|
745
746
|
hideOthers: function (callback) {
|
|
746
|
-
|
|
747
|
+
const $visibleModals = $otherModals.filter('.' + className.active + ', .' + className.animating);
|
|
747
748
|
callback = isFunction(callback)
|
|
748
749
|
? callback
|
|
749
750
|
: function () {};
|
|
@@ -773,17 +774,17 @@
|
|
|
773
774
|
|
|
774
775
|
save: {
|
|
775
776
|
focus: function () {
|
|
776
|
-
|
|
777
|
-
|
|
777
|
+
const $activeElement = $(document.activeElement);
|
|
778
|
+
const inCurrentModal = $activeElement.closest($module).length > 0;
|
|
778
779
|
if (!inCurrentModal) {
|
|
779
780
|
$focusedElement = $(document.activeElement).trigger('blur');
|
|
780
781
|
}
|
|
781
782
|
},
|
|
782
783
|
bodyMargin: function () {
|
|
783
784
|
initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
tempBodyMargin =
|
|
785
|
+
initialBodyMarginInt = Number.parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10);
|
|
786
|
+
const bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
|
|
787
|
+
tempBodyMargin = initialBodyMarginInt + bodyScrollbarWidth;
|
|
787
788
|
},
|
|
788
789
|
},
|
|
789
790
|
|
|
@@ -794,11 +795,11 @@
|
|
|
794
795
|
}
|
|
795
796
|
},
|
|
796
797
|
bodyMargin: function () {
|
|
797
|
-
|
|
798
|
-
$context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMargin);
|
|
798
|
+
const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
|
799
|
+
$context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMarginInt === 0 ? '' : initialBodyMargin);
|
|
799
800
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
|
800
|
-
|
|
801
|
-
|
|
801
|
+
const el = $(this);
|
|
802
|
+
const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
|
802
803
|
el.css(attribute, '');
|
|
803
804
|
});
|
|
804
805
|
},
|
|
@@ -852,9 +853,9 @@
|
|
|
852
853
|
|
|
853
854
|
cacheSizes: function () {
|
|
854
855
|
$module.addClass(className.loading);
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
856
|
+
const scrollHeight = $module.prop('scrollHeight');
|
|
857
|
+
const modalWidth = $module.outerWidth();
|
|
858
|
+
const modalHeight = $module.outerHeight();
|
|
858
859
|
if (module.cache.pageHeight === undefined || modalHeight !== 0) {
|
|
859
860
|
$.extend(module.cache, {
|
|
860
861
|
pageHeight: $document.outerHeight(),
|
|
@@ -876,8 +877,7 @@
|
|
|
876
877
|
return string;
|
|
877
878
|
}
|
|
878
879
|
|
|
879
|
-
const
|
|
880
|
-
const escape = {
|
|
880
|
+
const escapeMap = {
|
|
881
881
|
'"': '"',
|
|
882
882
|
'&': '&',
|
|
883
883
|
"'": ''',
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
'>': '>',
|
|
886
886
|
};
|
|
887
887
|
|
|
888
|
-
return string.replace(
|
|
888
|
+
return String(string).replace(/["&'<>]/g, (chr) => escapeMap[chr]);
|
|
889
889
|
},
|
|
890
890
|
},
|
|
891
891
|
can: {
|
|
@@ -907,13 +907,13 @@
|
|
|
907
907
|
return settings.useFlex;
|
|
908
908
|
},
|
|
909
909
|
fit: function () {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
910
|
+
const contextHeight = module.cache.contextHeight;
|
|
911
|
+
const verticalCenter = module.cache.contextHeight / 2;
|
|
912
|
+
const topOffset = module.cache.topOffset;
|
|
913
|
+
const scrollHeight = module.cache.scrollHeight;
|
|
914
|
+
const height = module.cache.height;
|
|
915
|
+
const paddingHeight = settings.padding;
|
|
916
|
+
const startPosition = verticalCenter + topOffset;
|
|
917
917
|
|
|
918
918
|
return scrollHeight > height
|
|
919
919
|
? startPosition + scrollHeight + paddingHeight < contextHeight
|
|
@@ -960,7 +960,7 @@
|
|
|
960
960
|
return module.cache.isFirefox;
|
|
961
961
|
},
|
|
962
962
|
iframe: function () {
|
|
963
|
-
return !(self === top);
|
|
963
|
+
return !(window.self === window.top);
|
|
964
964
|
},
|
|
965
965
|
},
|
|
966
966
|
|
|
@@ -969,9 +969,9 @@
|
|
|
969
969
|
observeAttributes = state !== false;
|
|
970
970
|
},
|
|
971
971
|
autofocus: function () {
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
972
|
+
const $autofocus = $inputs.filter('[autofocus]');
|
|
973
|
+
const $rawInputs = $inputs.filter(':input');
|
|
974
|
+
const $input = ($autofocus.length > 0
|
|
975
975
|
? $autofocus
|
|
976
976
|
: ($rawInputs.length > 0
|
|
977
977
|
? $rawInputs
|
|
@@ -980,13 +980,13 @@
|
|
|
980
980
|
$input.trigger('focus');
|
|
981
981
|
},
|
|
982
982
|
bodyMargin: function () {
|
|
983
|
-
|
|
983
|
+
const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
|
984
984
|
if (settings.detachable || module.can.fit()) {
|
|
985
985
|
$context.css((isBody ? 'margin-' : 'padding-') + position, tempBodyMargin + 'px');
|
|
986
986
|
}
|
|
987
987
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
|
988
|
-
|
|
989
|
-
|
|
988
|
+
const el = $(this);
|
|
989
|
+
const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
|
990
990
|
el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
|
|
991
991
|
});
|
|
992
992
|
},
|
|
@@ -1006,7 +1006,7 @@
|
|
|
1006
1006
|
|
|
1007
1007
|
return;
|
|
1008
1008
|
}
|
|
1009
|
-
|
|
1009
|
+
const defaultSettings = {
|
|
1010
1010
|
debug: settings.debug,
|
|
1011
1011
|
dimmerName: 'modals',
|
|
1012
1012
|
closable: 'auto',
|
|
@@ -1016,7 +1016,7 @@
|
|
|
1016
1016
|
hide: settings.transition.hideDuration || settings.duration,
|
|
1017
1017
|
},
|
|
1018
1018
|
};
|
|
1019
|
-
|
|
1019
|
+
const dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings);
|
|
1020
1020
|
if (settings.inverted) {
|
|
1021
1021
|
dimmerSettings.variation = dimmerSettings.variation !== undefined
|
|
1022
1022
|
? dimmerSettings.variation + ' inverted'
|
|
@@ -1038,7 +1038,7 @@
|
|
|
1038
1038
|
},
|
|
1039
1039
|
modalOffset: function () {
|
|
1040
1040
|
if (!settings.detachable) {
|
|
1041
|
-
|
|
1041
|
+
const canFit = module.can.fit();
|
|
1042
1042
|
$module
|
|
1043
1043
|
.css({
|
|
1044
1044
|
top: !$module.hasClass('aligned') && canFit
|
|
@@ -1122,30 +1122,30 @@
|
|
|
1122
1122
|
return module[name];
|
|
1123
1123
|
}
|
|
1124
1124
|
},
|
|
1125
|
-
debug: function () {
|
|
1125
|
+
debug: function (...args) {
|
|
1126
1126
|
if (!settings.silent && settings.debug) {
|
|
1127
1127
|
if (settings.performance) {
|
|
1128
|
-
module.performance.log(
|
|
1128
|
+
module.performance.log(args);
|
|
1129
1129
|
} else {
|
|
1130
1130
|
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
|
1131
|
-
module.debug.apply(console,
|
|
1131
|
+
module.debug.apply(console, args);
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
1134
|
},
|
|
1135
|
-
verbose: function () {
|
|
1135
|
+
verbose: function (...args) {
|
|
1136
1136
|
if (!settings.silent && settings.verbose && settings.debug) {
|
|
1137
1137
|
if (settings.performance) {
|
|
1138
|
-
module.performance.log(
|
|
1138
|
+
module.performance.log(args);
|
|
1139
1139
|
} else {
|
|
1140
1140
|
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
|
1141
|
-
module.verbose.apply(console,
|
|
1141
|
+
module.verbose.apply(console, args);
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
1144
|
},
|
|
1145
|
-
error: function () {
|
|
1145
|
+
error: function (...args) {
|
|
1146
1146
|
if (!settings.silent) {
|
|
1147
1147
|
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
|
1148
|
-
module.error.apply(console,
|
|
1148
|
+
module.error.apply(console, args);
|
|
1149
1149
|
}
|
|
1150
1150
|
},
|
|
1151
1151
|
performance: {
|
|
@@ -1160,7 +1160,7 @@
|
|
|
1160
1160
|
time = currentTime;
|
|
1161
1161
|
performance.push({
|
|
1162
1162
|
Name: message[0],
|
|
1163
|
-
Arguments:
|
|
1163
|
+
Arguments: message.slice(1),
|
|
1164
1164
|
Element: element,
|
|
1165
1165
|
'Execution Time': executionTime,
|
|
1166
1166
|
});
|
|
@@ -1181,30 +1181,22 @@
|
|
|
1181
1181
|
title += ' ' + totalTime + 'ms';
|
|
1182
1182
|
if (performance.length > 0) {
|
|
1183
1183
|
console.groupCollapsed(title);
|
|
1184
|
-
|
|
1185
|
-
console.table(performance);
|
|
1186
|
-
} else {
|
|
1187
|
-
$.each(performance, function (index, data) {
|
|
1188
|
-
console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
|
|
1189
|
-
});
|
|
1190
|
-
}
|
|
1184
|
+
console.table(performance);
|
|
1191
1185
|
console.groupEnd();
|
|
1192
1186
|
}
|
|
1193
1187
|
performance = [];
|
|
1194
1188
|
},
|
|
1195
1189
|
},
|
|
1196
|
-
invoke: function (query, passedArguments, context) {
|
|
1190
|
+
invoke: function (query, passedArguments = queryArguments, context = element) {
|
|
1197
1191
|
let object = instance;
|
|
1198
1192
|
let maxDepth;
|
|
1199
1193
|
let found;
|
|
1200
1194
|
let response;
|
|
1201
|
-
passedArguments = passedArguments || queryArguments;
|
|
1202
|
-
context = context || element;
|
|
1203
1195
|
if (typeof query === 'string' && object !== undefined) {
|
|
1204
1196
|
query = query.split(/[ .]/);
|
|
1205
1197
|
maxDepth = query.length - 1;
|
|
1206
1198
|
$.each(query, function (depth, value) {
|
|
1207
|
-
|
|
1199
|
+
const camelCaseValue = depth !== maxDepth
|
|
1208
1200
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
1209
1201
|
: query;
|
|
1210
1202
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
|
@@ -1245,10 +1237,10 @@
|
|
|
1245
1237
|
|
|
1246
1238
|
if (methodInvoked) {
|
|
1247
1239
|
if (instance === undefined) {
|
|
1248
|
-
if (isFunction(settings.templates[
|
|
1240
|
+
if (isFunction(settings.templates[parameters])) {
|
|
1249
1241
|
settings.autoShow = true;
|
|
1250
1242
|
settings.className.modal = settings.className.template;
|
|
1251
|
-
settings = $.extend(true, {}, settings, settings.templates[
|
|
1243
|
+
settings = $.extend(true, {}, settings, settings.templates[parameters].apply(module, queryArguments));
|
|
1252
1244
|
|
|
1253
1245
|
// reassign shortcuts
|
|
1254
1246
|
className = settings.className;
|
|
@@ -1258,8 +1250,8 @@
|
|
|
1258
1250
|
}
|
|
1259
1251
|
module.initialize();
|
|
1260
1252
|
}
|
|
1261
|
-
if (!isFunction(settings.templates[
|
|
1262
|
-
module.invoke(
|
|
1253
|
+
if (!isFunction(settings.templates[parameters])) {
|
|
1254
|
+
module.invoke(parameters);
|
|
1263
1255
|
}
|
|
1264
1256
|
} else {
|
|
1265
1257
|
if (instance !== undefined) {
|
|
@@ -1418,8 +1410,7 @@
|
|
|
1418
1410
|
};
|
|
1419
1411
|
|
|
1420
1412
|
$.fn.modal.settings.templates = {
|
|
1421
|
-
getArguments: function (
|
|
1422
|
-
let queryArguments = [].slice.call(args);
|
|
1413
|
+
getArguments: function (queryArguments) {
|
|
1423
1414
|
if ($.isPlainObject(queryArguments[0])) {
|
|
1424
1415
|
return $.extend({
|
|
1425
1416
|
handler: function () {},
|
|
@@ -1437,10 +1428,10 @@
|
|
|
1437
1428
|
title: queryArguments.pop() || '',
|
|
1438
1429
|
};
|
|
1439
1430
|
},
|
|
1440
|
-
alert: function () {
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1431
|
+
alert: function (...args) {
|
|
1432
|
+
const settings = this.get.settings();
|
|
1433
|
+
args = settings.templates.getArguments(args);
|
|
1434
|
+
const approveFn = args.handler;
|
|
1444
1435
|
|
|
1445
1436
|
return {
|
|
1446
1437
|
title: args.title,
|
|
@@ -1453,13 +1444,13 @@
|
|
|
1453
1444
|
}],
|
|
1454
1445
|
};
|
|
1455
1446
|
},
|
|
1456
|
-
confirm: function () {
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1447
|
+
confirm: function (...args) {
|
|
1448
|
+
const settings = this.get.settings();
|
|
1449
|
+
args = settings.templates.getArguments(args);
|
|
1450
|
+
const approveFn = function () {
|
|
1460
1451
|
args.handler(true);
|
|
1461
1452
|
};
|
|
1462
|
-
|
|
1453
|
+
const denyFn = function () {
|
|
1463
1454
|
args.handler(false);
|
|
1464
1455
|
};
|
|
1465
1456
|
|
|
@@ -1479,17 +1470,17 @@
|
|
|
1479
1470
|
}],
|
|
1480
1471
|
};
|
|
1481
1472
|
},
|
|
1482
|
-
prompt: function () {
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1473
|
+
prompt: function (...args) {
|
|
1474
|
+
const $this = this;
|
|
1475
|
+
const settings = this.get.settings();
|
|
1476
|
+
args = settings.templates.getArguments(args);
|
|
1477
|
+
const input = $($.parseHTML(args.content)).filter('.ui.input');
|
|
1478
|
+
const approveFn = function () {
|
|
1479
|
+
const settings = $this.get.settings();
|
|
1480
|
+
const inputField = $this.get.element().find(settings.selector.prompt)[0];
|
|
1490
1481
|
args.handler($(inputField).val());
|
|
1491
1482
|
};
|
|
1492
|
-
|
|
1483
|
+
const denyFn = function () {
|
|
1493
1484
|
args.handler(null);
|
|
1494
1485
|
};
|
|
1495
1486
|
if (input.length === 0) {
|