fomantic-ui 2.10.0-beta.2 → 2.10.0-beta.21
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/.all-contributorsrc +9 -0
- package/.eslintrc.js +0 -10
- package/CHANGELOG.md +5289 -2325
- package/CONTRIBUTING.md +4 -1
- package/CONTRIBUTORS.md +1 -0
- package/FAQ.md +7 -2
- package/README.md +5 -9
- package/ROADMAP.md +4 -4
- package/SECURITY.md +8 -7
- package/changelog-setup.js +85 -69
- package/changelog-template.hbs +256 -251
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +103 -142
- 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 +157 -210
- 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 -2
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +1 -2
- package/dist/components/calendar.js +314 -352
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -2
- package/dist/components/checkbox.js +85 -135
- package/dist/components/checkbox.min.css +2 -2
- 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 +2 -4
- package/dist/components/container.min.css +2 -2
- package/dist/components/dimmer.css +1 -11
- package/dist/components/dimmer.js +61 -94
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -2
- package/dist/components/divider.min.css +2 -2
- package/dist/components/dropdown.css +30 -51
- package/dist/components/dropdown.js +754 -1096
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +84 -114
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- 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 +2 -3
- package/dist/components/flyout.js +225 -355
- package/dist/components/flyout.min.css +2 -2
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +5 -95
- package/dist/components/form.js +335 -444
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +2 -58
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +4 -4
- 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 +1 -536
- 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 -3
- package/dist/components/list.min.css +2 -2
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +40 -48
- package/dist/components/menu.min.css +2 -2
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +5 -9
- package/dist/components/modal.js +260 -384
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +68 -98
- 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 -2
- package/dist/components/popup.js +197 -271
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +109 -144
- 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 +90 -123
- 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 +2 -9
- package/dist/components/search.js +276 -379
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +2 -7
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -2
- package/dist/components/shape.js +158 -224
- package/dist/components/shape.min.css +2 -2
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +2 -3
- package/dist/components/sidebar.js +124 -206
- package/dist/components/sidebar.min.css +2 -2
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +9 -25
- package/dist/components/site.js +38 -57
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +246 -329
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +70 -100
- 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 +135 -180
- 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 +176 -241
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +3 -37
- 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 -3
- package/dist/components/toast.js +108 -147
- 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 +91 -146
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +146 -224
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +3945 -8759
- package/dist/semantic.js +4408 -6193
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/assets/show-examples.js +2 -4
- package/examples/attached.html +1 -1
- package/examples/components/menu.html +1 -1
- package/gulpfile.js +5 -7
- package/package.json +3 -6
- package/scripts/nightly-version.js +7 -10
- package/src/README.md +3 -3
- package/src/definitions/behaviors/api.js +156 -209
- package/src/definitions/behaviors/form.js +334 -443
- package/src/definitions/behaviors/state.js +69 -99
- package/src/definitions/behaviors/visibility.js +145 -223
- package/src/definitions/collections/form.less +1 -13
- package/src/definitions/collections/grid.less +1 -61
- package/src/definitions/collections/menu.less +101 -107
- package/src/definitions/collections/table.less +1 -35
- package/src/definitions/elements/input.less +1 -61
- package/src/definitions/elements/segment.less +0 -6
- package/src/definitions/globals/site.js +37 -56
- package/src/definitions/globals/site.less +2 -18
- package/src/definitions/modules/accordion.js +102 -141
- package/src/definitions/modules/calendar.js +313 -351
- package/src/definitions/modules/checkbox.js +84 -134
- package/src/definitions/modules/dimmer.js +60 -93
- package/src/definitions/modules/dimmer.less +0 -9
- package/src/definitions/modules/dropdown.js +753 -1095
- package/src/definitions/modules/dropdown.less +31 -47
- package/src/definitions/modules/embed.js +83 -113
- package/src/definitions/modules/flyout.js +224 -354
- package/src/definitions/modules/modal.js +259 -383
- package/src/definitions/modules/modal.less +1 -1
- package/src/definitions/modules/nag.js +67 -97
- package/src/definitions/modules/popup.js +196 -270
- package/src/definitions/modules/progress.js +108 -143
- package/src/definitions/modules/rating.js +89 -122
- package/src/definitions/modules/search.js +275 -378
- package/src/definitions/modules/search.less +0 -3
- package/src/definitions/modules/shape.js +157 -223
- package/src/definitions/modules/sidebar.js +123 -205
- package/src/definitions/modules/slider.js +245 -328
- package/src/definitions/modules/slider.less +1 -1
- package/src/definitions/modules/sticky.js +134 -179
- package/src/definitions/modules/tab.js +175 -240
- package/src/definitions/modules/toast.js +107 -146
- package/src/definitions/modules/toast.less +1 -1
- package/src/definitions/modules/transition.js +90 -145
- package/src/theme.less +0 -13
- package/src/themes/basic/elements/icon.variables +1 -1
- package/src/themes/chubby/collections/menu.variables +1 -1
- package/src/themes/default/collections/grid.variables +0 -30
- package/src/themes/default/collections/menu.variables +23 -23
- package/src/themes/default/collections/table.variables +1 -5
- package/src/themes/default/elements/icon.variables +3 -3
- package/src/themes/default/globals/site.variables +8 -15
- package/src/themes/default/globals/variation.variables +3 -3
- package/src/themes/default/modules/dropdown.variables +1 -0
- package/src/themes/default/modules/slider.variables +1 -1
- package/src/themes/github/elements/icon.variables +1 -1
- package/src/themes/material/elements/icon.variables +1 -1
- package/tasks/README.md +1 -1
- package/tasks/admin/components/create.js +89 -122
- package/tasks/admin/components/init.js +34 -65
- package/tasks/admin/components/update.js +50 -61
- package/tasks/admin/distributions/create.js +71 -111
- package/tasks/admin/distributions/init.js +32 -63
- package/tasks/admin/distributions/update.js +49 -57
- package/tasks/admin/publish.js +1 -1
- package/tasks/admin/register.js +14 -19
- package/tasks/admin/release.js +2 -2
- package/tasks/build/assets.js +14 -18
- package/tasks/build/css.js +59 -68
- package/tasks/build/javascript.js +48 -56
- package/tasks/build.js +4 -6
- package/tasks/check-install.js +5 -8
- package/tasks/clean.js +5 -7
- package/tasks/collections/admin.js +14 -16
- package/tasks/collections/build.js +6 -8
- package/tasks/collections/docs.js +4 -6
- package/tasks/collections/install.js +2 -4
- package/tasks/collections/rtl.js +2 -4
- package/tasks/collections/various.js +2 -4
- package/tasks/config/admin/github.js +9 -19
- package/tasks/config/admin/templates/README.md +2 -2
- package/tasks/config/admin/templates/bower.json +2 -4
- package/tasks/config/admin/templates/composer.json +1 -1
- package/tasks/config/admin/templates/css-package.js +1 -4
- package/tasks/config/admin/templates/less-package.js +1 -3
- package/tasks/config/defaults.js +0 -1
- package/tasks/config/npm/gulpfile.js +4 -6
- package/tasks/config/project/config.js +27 -35
- package/tasks/config/project/install.js +64 -82
- package/tasks/config/project/release.js +7 -9
- package/tasks/config/tasks.js +10 -21
- package/tasks/config/user.js +14 -20
- package/tasks/docs/build.js +26 -31
- package/tasks/docs/metadata.js +30 -39
- package/tasks/docs/serve.js +23 -27
- package/tasks/install.js +94 -128
- package/tasks/rtl/build.js +2 -4
- package/tasks/rtl/watch.js +3 -5
- package/tasks/watch.js +13 -13
- package/test/meteor/fonts.js +1 -2
- package/test/modules/module.spec.js +16 -18
- package/types/fomantic-ui-calendar.d.ts +1 -1
- package/types/fomantic-ui-dropdown.d.ts +45 -1
- package/types/fomantic-ui-embed.d.ts +1 -1
- package/types/fomantic-ui-flyout.d.ts +1 -1
- package/types/fomantic-ui-form.d.ts +0 -7
- package/types/fomantic-ui-modal.d.ts +1 -1
- package/types/fomantic-ui-search.d.ts +12 -6
- package/types/fomantic-ui-toast.d.ts +1 -1
- package/src/themes/basic/assets/fonts/icons.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-Bold.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-Italic.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-Regular.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
- package/src/themes/default/assets/fonts/brand-icons.woff +0 -0
- package/src/themes/default/assets/fonts/icons.woff +0 -0
- package/src/themes/default/assets/fonts/outline-icons.woff +0 -0
- package/src/themes/github/assets/fonts/octicons.woff +0 -0
- package/src/themes/material/assets/fonts/icons.woff +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.10.0-beta.
|
2
|
+
* # Fomantic-UI 2.10.0-beta.21+d6168a0 - Flyout
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -20,82 +20,78 @@
|
|
20
20
|
: globalThis;
|
21
21
|
|
22
22
|
$.fn.flyout = function (parameters) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
$context = win.frameElement ? contextCheck(context, win.parent) : $body;
|
45
|
-
}
|
23
|
+
let $allModules = $(this);
|
24
|
+
let $window = $(window);
|
25
|
+
let $document = $(document);
|
26
|
+
let $html = $('html');
|
27
|
+
let $head = $('head');
|
28
|
+
let $body = $('body');
|
29
|
+
|
30
|
+
let time = Date.now();
|
31
|
+
let performance = [];
|
32
|
+
|
33
|
+
let query = arguments[0];
|
34
|
+
let methodInvoked = typeof query === 'string';
|
35
|
+
let queryArguments = [].slice.call(arguments, 1);
|
36
|
+
let contextCheck = function (context, win) {
|
37
|
+
let $context;
|
38
|
+
if ([window, document].indexOf(context) >= 0) {
|
39
|
+
$context = $body;
|
40
|
+
} else {
|
41
|
+
$context = $(win.document).find(context);
|
42
|
+
if ($context.length === 0) {
|
43
|
+
$context = win.frameElement ? contextCheck(context, win.parent) : $body;
|
46
44
|
}
|
45
|
+
}
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
;
|
47
|
+
return $context;
|
48
|
+
};
|
49
|
+
let returnedValue;
|
52
50
|
|
53
51
|
$allModules.each(function () {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
module
|
98
|
-
;
|
52
|
+
let settings = $.isPlainObject(parameters)
|
53
|
+
? $.extend(true, {}, $.fn.flyout.settings, parameters)
|
54
|
+
: $.extend({}, $.fn.flyout.settings);
|
55
|
+
|
56
|
+
let selector = settings.selector;
|
57
|
+
let className = settings.className;
|
58
|
+
let namespace = settings.namespace;
|
59
|
+
let fields = settings.fields;
|
60
|
+
let regExp = settings.regExp;
|
61
|
+
let error = settings.error;
|
62
|
+
|
63
|
+
let eventNamespace = '.' + namespace;
|
64
|
+
let moduleNamespace = 'module-' + namespace;
|
65
|
+
|
66
|
+
let $module = $(this);
|
67
|
+
let $context = contextCheck(settings.context, window);
|
68
|
+
let $closeIcon = $module.find(selector.close);
|
69
|
+
let $inputs;
|
70
|
+
let $focusedElement;
|
71
|
+
|
72
|
+
let $flyouts = $module.children(selector.flyout);
|
73
|
+
let $pusher = $context.children(selector.pusher);
|
74
|
+
let $style;
|
75
|
+
|
76
|
+
let isFlyoutComponent = $module.hasClass('flyout');
|
77
|
+
|
78
|
+
let element = this;
|
79
|
+
let instance = isFlyoutComponent ? $module.data(moduleNamespace) : undefined;
|
80
|
+
|
81
|
+
let ignoreRepeatedEvents = false;
|
82
|
+
let isBody = $context[0] === $body[0];
|
83
|
+
let initialBodyMargin = '';
|
84
|
+
let tempBodyMargin = '';
|
85
|
+
let hadScrollbar = false;
|
86
|
+
let windowRefocused = false;
|
87
|
+
|
88
|
+
let elementNamespace;
|
89
|
+
let id;
|
90
|
+
let observer;
|
91
|
+
let observeAttributes = false;
|
92
|
+
let currentScroll;
|
93
|
+
|
94
|
+
let module;
|
99
95
|
|
100
96
|
module = {
|
101
97
|
|
@@ -117,29 +113,27 @@
|
|
117
113
|
}
|
118
114
|
$module.addClass(settings.class);
|
119
115
|
if (settings.title !== '') {
|
120
|
-
$module.find(selector.header).html(module.helpers.escape(settings.title, settings
|
116
|
+
$module.find(selector.header).html(module.helpers.escape(settings.title, settings)).addClass(settings.classTitle);
|
121
117
|
}
|
122
118
|
if (settings.content !== '') {
|
123
|
-
$module.find(selector.content).html(module.helpers.escape(settings.content, settings
|
119
|
+
$module.find(selector.content).html(module.helpers.escape(settings.content, settings)).addClass(settings.classContent);
|
124
120
|
}
|
125
121
|
if (module.has.configActions()) {
|
126
|
-
|
122
|
+
let $actions = $module.find(selector.actions).addClass(settings.classActions);
|
127
123
|
if ($actions.length === 0) {
|
128
124
|
$actions = $('<div/>', { class: className.actions + ' ' + (settings.classActions || '') }).appendTo($module);
|
129
125
|
} else {
|
130
126
|
$actions.empty();
|
131
127
|
}
|
132
128
|
settings.actions.forEach(function (el) {
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
: function () {}
|
142
|
-
;
|
129
|
+
let icon = el[fields.icon]
|
130
|
+
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '') + ' class="' + module.helpers.escape(el[fields.icon]) + ' icon"></i>'
|
131
|
+
: '';
|
132
|
+
let text = module.helpers.escape(el[fields.text] || '', settings);
|
133
|
+
let cls = module.helpers.escape(el[fields.class] || '');
|
134
|
+
let click = el[fields.click] && isFunction(el[fields.click])
|
135
|
+
? el[fields.click]
|
136
|
+
: function () {};
|
143
137
|
$actions.append($('<button/>', {
|
144
138
|
html: icon + text,
|
145
139
|
'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g, ''),
|
@@ -184,13 +178,12 @@
|
|
184
178
|
module.verbose('Storing instance of module', module);
|
185
179
|
instance = module;
|
186
180
|
$module
|
187
|
-
.data(moduleNamespace, instance)
|
188
|
-
;
|
181
|
+
.data(moduleNamespace, instance);
|
189
182
|
},
|
190
183
|
|
191
184
|
create: {
|
192
185
|
flyout: function () {
|
193
|
-
module.verbose('
|
186
|
+
module.verbose('Programmatically create flyout', $context);
|
194
187
|
$module = $('<div/>', { class: className.flyout, role: 'dialog', 'aria-modal': settings.dimPage });
|
195
188
|
if (settings.closeIcon) {
|
196
189
|
$closeIcon = $('<i/>', {
|
@@ -202,12 +195,12 @@
|
|
202
195
|
$module.append($closeIcon);
|
203
196
|
}
|
204
197
|
if (settings.title !== '') {
|
205
|
-
|
198
|
+
let titleId = '_' + module.get.id() + 'title';
|
206
199
|
$module.attr('aria-labelledby', titleId);
|
207
200
|
$('<div/>', { class: className.header, id: titleId }).appendTo($module);
|
208
201
|
}
|
209
202
|
if (settings.content !== '') {
|
210
|
-
|
203
|
+
let descId = '_' + module.get.id() + 'desc';
|
211
204
|
$module.attr('aria-describedby', descId);
|
212
205
|
$('<div/>', { class: className.content, id: descId }).appendTo($module);
|
213
206
|
}
|
@@ -231,8 +224,7 @@
|
|
231
224
|
module.verbose('Destroying previous module for', $module);
|
232
225
|
$module
|
233
226
|
.off(eventNamespace)
|
234
|
-
.removeData(moduleNamespace)
|
235
|
-
;
|
227
|
+
.removeData(moduleNamespace);
|
236
228
|
$closeIcon.off(elementNamespace);
|
237
229
|
if ($inputs) {
|
238
230
|
$inputs.off(elementNamespace);
|
@@ -245,9 +237,7 @@
|
|
245
237
|
|
246
238
|
event: {
|
247
239
|
keyboard: function (event) {
|
248
|
-
|
249
|
-
keyCode = event.which
|
250
|
-
;
|
240
|
+
let keyCode = event.which;
|
251
241
|
if (keyCode === settings.keys.escape) {
|
252
242
|
if (settings.closable) {
|
253
243
|
module.debug('Escape key pressed hiding flyout');
|
@@ -272,10 +262,8 @@
|
|
272
262
|
},
|
273
263
|
clickaway: function (event) {
|
274
264
|
if (settings.closable) {
|
275
|
-
|
276
|
-
|
277
|
-
clickedContext = $context.is(event.target)
|
278
|
-
;
|
265
|
+
let clickedInPusher = $pusher.find(event.target).length > 0 || $pusher.is(event.target);
|
266
|
+
let clickedContext = $context.is(event.target);
|
279
267
|
if (clickedInPusher) {
|
280
268
|
module.verbose('User clicked on dimmed page');
|
281
269
|
module.hide();
|
@@ -290,27 +278,21 @@
|
|
290
278
|
module.hide();
|
291
279
|
},
|
292
280
|
closeKeyUp: function (event) {
|
293
|
-
|
294
|
-
keyCode = event.which
|
295
|
-
;
|
281
|
+
let keyCode = event.which;
|
296
282
|
if (keyCode === settings.keys.enter || keyCode === settings.keys.space) {
|
297
283
|
module.hide();
|
298
284
|
}
|
299
285
|
},
|
300
286
|
inputKeyDown: {
|
301
287
|
first: function (event) {
|
302
|
-
|
303
|
-
keyCode = event.which
|
304
|
-
;
|
288
|
+
let keyCode = event.which;
|
305
289
|
if (keyCode === settings.keys.tab && event.shiftKey) {
|
306
290
|
$inputs.last().trigger('focus');
|
307
291
|
event.preventDefault();
|
308
292
|
}
|
309
293
|
},
|
310
294
|
last: function (event) {
|
311
|
-
|
312
|
-
keyCode = event.which
|
313
|
-
;
|
295
|
+
let keyCode = event.which;
|
314
296
|
if (keyCode === settings.keys.tab && !event.shiftKey) {
|
315
297
|
$inputs.first().trigger('focus');
|
316
298
|
event.preventDefault();
|
@@ -367,24 +349,19 @@
|
|
367
349
|
$module
|
368
350
|
.on('click' + eventNamespace, selector.close, module.event.close)
|
369
351
|
.on('click' + eventNamespace, selector.approve, module.event.approve)
|
370
|
-
.on('click' + eventNamespace, selector.deny, module.event.deny)
|
371
|
-
;
|
352
|
+
.on('click' + eventNamespace, selector.deny, module.event.deny);
|
372
353
|
$closeIcon
|
373
|
-
.on('keyup' + elementNamespace, module.event.closeKeyUp)
|
374
|
-
;
|
354
|
+
.on('keyup' + elementNamespace, module.event.closeKeyUp);
|
375
355
|
$window
|
376
|
-
.on('focus' + elementNamespace, module.event.focus)
|
377
|
-
;
|
356
|
+
.on('focus' + elementNamespace, module.event.focus);
|
378
357
|
$context
|
379
|
-
.on('click' + elementNamespace, module.event.click)
|
380
|
-
;
|
358
|
+
.on('click' + elementNamespace, module.event.click);
|
381
359
|
},
|
382
360
|
clickaway: function () {
|
383
361
|
module.verbose('Adding clickaway events to context', $context);
|
384
362
|
$context
|
385
363
|
.on('click' + elementNamespace, module.event.clickaway)
|
386
|
-
.on('touchend' + elementNamespace, module.event.clickaway)
|
387
|
-
;
|
364
|
+
.on('touchend' + elementNamespace, module.event.clickaway);
|
388
365
|
},
|
389
366
|
scrollLock: function () {
|
390
367
|
if (settings.scrollLock) {
|
@@ -398,11 +375,9 @@
|
|
398
375
|
}
|
399
376
|
module.verbose('Adding events to contain flyout scroll');
|
400
377
|
$document
|
401
|
-
.on('touchmove' + elementNamespace, module.event.touch)
|
402
|
-
;
|
378
|
+
.on('touchmove' + elementNamespace, module.event.touch);
|
403
379
|
$module
|
404
|
-
.on('scroll' + eventNamespace, module.event.containScroll)
|
405
|
-
;
|
380
|
+
.on('scroll' + eventNamespace, module.event.containScroll);
|
406
381
|
},
|
407
382
|
},
|
408
383
|
unbind: {
|
@@ -423,19 +398,17 @@
|
|
423
398
|
|
424
399
|
add: {
|
425
400
|
inlineCSS: function () {
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
style
|
438
|
-
;
|
401
|
+
let width = module.cache.width || $module.outerWidth();
|
402
|
+
let height = module.cache.height || $module.outerHeight();
|
403
|
+
let isRTL = module.is.rtl();
|
404
|
+
let direction = module.get.direction();
|
405
|
+
let distance = {
|
406
|
+
left: width,
|
407
|
+
right: -width,
|
408
|
+
top: height,
|
409
|
+
bottom: -height,
|
410
|
+
};
|
411
|
+
let style;
|
439
412
|
|
440
413
|
if (isRTL) {
|
441
414
|
module.verbose('RTL detected, flipping widths');
|
@@ -460,89 +433,62 @@
|
|
460
433
|
+ ' }';
|
461
434
|
}
|
462
435
|
|
463
|
-
/* IE is only browser not to create context with transforms */
|
464
|
-
/* https://www.w3.org/Bugs/Public/show_bug.cgi?id=16328 */
|
465
|
-
if (module.is.ie()) {
|
466
|
-
if (direction === 'left' || direction === 'right') {
|
467
|
-
module.debug('Adding CSS rules for animation distance', width);
|
468
|
-
style += ''
|
469
|
-
+ ' body.pushable > .ui.visible.' + direction + '.flyout ~ .pusher::after {'
|
470
|
-
+ ' transform: translate3d(' + distance[direction] + 'px, 0, 0);'
|
471
|
-
+ ' }';
|
472
|
-
} else if (direction === 'top' || direction === 'bottom') {
|
473
|
-
style += ''
|
474
|
-
+ ' body.pushable > .ui.visible.' + direction + '.flyout ~ .pusher::after {'
|
475
|
-
+ ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
476
|
-
+ ' }';
|
477
|
-
}
|
478
|
-
/* opposite sides visible forces content overlay */
|
479
|
-
style += ''
|
480
|
-
+ ' body.pushable > .ui.visible.left.flyout ~ .ui.visible.right.flyout ~ .pusher::after,'
|
481
|
-
+ ' body.pushable > .ui.visible.right.flyout ~ .ui.visible.left.flyout ~ .pusher::after {'
|
482
|
-
+ ' transform: translate3d(0, 0, 0);'
|
483
|
-
+ ' }';
|
484
|
-
}
|
485
436
|
style += '</style>';
|
486
437
|
$style = $(style)
|
487
|
-
.appendTo($head)
|
488
|
-
;
|
438
|
+
.appendTo($head);
|
489
439
|
module.debug('Adding sizing css to head', $style);
|
490
440
|
},
|
491
441
|
keyboardShortcuts: function () {
|
492
442
|
module.verbose('Adding keyboard shortcuts');
|
493
443
|
$document
|
494
|
-
.on('keydown' + eventNamespace, module.event.keyboard)
|
495
|
-
;
|
444
|
+
.on('keydown' + eventNamespace, module.event.keyboard);
|
496
445
|
},
|
497
446
|
},
|
498
447
|
observeChanges: function () {
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
}
|
448
|
+
observer = new MutationObserver(function (mutations) {
|
449
|
+
let collectNodes = function (parent) {
|
450
|
+
let nodes = [];
|
451
|
+
for (let c = 0, cl = parent.length; c < cl; c++) {
|
452
|
+
Array.prototype.push.apply(nodes, collectNodes(parent[c].childNodes));
|
453
|
+
nodes.push(parent[c]);
|
454
|
+
}
|
507
455
|
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
if (mutation.
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
ignoreAutofocus = false;
|
527
|
-
}
|
456
|
+
return nodes;
|
457
|
+
};
|
458
|
+
let shouldRefreshInputs = false;
|
459
|
+
let ignoreAutofocus = true;
|
460
|
+
mutations.every(function (mutation) {
|
461
|
+
if (mutation.type === 'attributes') {
|
462
|
+
if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').filter(':visible').length > 0)) {
|
463
|
+
shouldRefreshInputs = true;
|
464
|
+
}
|
465
|
+
} else {
|
466
|
+
// mutationobserver only provides the parent nodes,
|
467
|
+
// so let's collect all childs as well to find nested inputs
|
468
|
+
let $addedInputs = $(collectNodes(mutation.addedNodes)).filter('a[href], [tabindex], :input:enabled').filter(':visible');
|
469
|
+
let $removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
|
470
|
+
if ($addedInputs.length > 0 || $removedInputs.length > 0) {
|
471
|
+
shouldRefreshInputs = true;
|
472
|
+
if ($addedInputs.filter(':input').length > 0 || $removedInputs.filter(':input').length > 0) {
|
473
|
+
ignoreAutofocus = false;
|
528
474
|
}
|
529
475
|
}
|
530
|
-
|
531
|
-
return !shouldRefreshInputs;
|
532
|
-
});
|
533
|
-
|
534
|
-
if (shouldRefreshInputs) {
|
535
|
-
module.refreshInputs(ignoreAutofocus);
|
536
476
|
}
|
477
|
+
|
478
|
+
return !shouldRefreshInputs;
|
537
479
|
});
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
480
|
+
|
481
|
+
if (shouldRefreshInputs) {
|
482
|
+
module.refreshInputs(ignoreAutofocus);
|
483
|
+
}
|
484
|
+
});
|
485
|
+
observer.observe(element, {
|
486
|
+
attributeFilter: ['class', 'disabled'],
|
487
|
+
attributes: true,
|
488
|
+
childList: true,
|
489
|
+
subtree: true,
|
490
|
+
});
|
491
|
+
module.debug('Setting up mutation observer', observer);
|
546
492
|
},
|
547
493
|
refresh: function () {
|
548
494
|
module.verbose('Refreshing selector cache');
|
@@ -560,8 +506,7 @@
|
|
560
506
|
refreshInputs: function (ignoreAutofocus) {
|
561
507
|
if ($inputs) {
|
562
508
|
$inputs
|
563
|
-
.off('keydown' + elementNamespace)
|
564
|
-
;
|
509
|
+
.off('keydown' + elementNamespace);
|
565
510
|
}
|
566
511
|
if (!settings.dimPage) {
|
567
512
|
return;
|
@@ -576,11 +521,9 @@
|
|
576
521
|
$module.removeAttr('tabindex');
|
577
522
|
}
|
578
523
|
$inputs.first()
|
579
|
-
.on('keydown' + elementNamespace, module.event.inputKeyDown.first)
|
580
|
-
;
|
524
|
+
.on('keydown' + elementNamespace, module.event.inputKeyDown.first);
|
581
525
|
$inputs.last()
|
582
|
-
.on('keydown' + elementNamespace, module.event.inputKeyDown.last)
|
583
|
-
;
|
526
|
+
.on('keydown' + elementNamespace, module.event.inputKeyDown.last);
|
584
527
|
if (!ignoreAutofocus && settings.autofocus && $inputs.filter(':focus').length === 0) {
|
585
528
|
module.set.autofocus();
|
586
529
|
}
|
@@ -602,8 +545,7 @@
|
|
602
545
|
.children()
|
603
546
|
.not(selector.omitted)
|
604
547
|
.not($flyouts)
|
605
|
-
.wrapAll($pusher)
|
606
|
-
;
|
548
|
+
.wrapAll($pusher);
|
607
549
|
module.refresh();
|
608
550
|
}
|
609
551
|
if ($module.nextAll(selector.pusher).length === 0 || $module.nextAll(selector.pusher)[0] !== $pusher[0]) {
|
@@ -621,12 +563,10 @@
|
|
621
563
|
},
|
622
564
|
heights: function () {
|
623
565
|
module.debug('Setting up heights', $module);
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
newContentHeight = ($context.height() || 0) - ($header.outerHeight() || 0) - ($actions.outerHeight() || 0)
|
629
|
-
;
|
566
|
+
let $header = $module.children(selector.header);
|
567
|
+
let $content = $module.children(selector.content);
|
568
|
+
let $actions = $module.children(selector.actions);
|
569
|
+
let newContentHeight = ($context.height() || 0) - ($header.outerHeight() || 0) - ($actions.outerHeight() || 0);
|
630
570
|
if (newContentHeight > 0) {
|
631
571
|
$content.css('min-height', String(newContentHeight) + 'px');
|
632
572
|
}
|
@@ -634,17 +574,14 @@
|
|
634
574
|
},
|
635
575
|
|
636
576
|
attachEvents: function (selector, event) {
|
637
|
-
|
638
|
-
$toggle = $(selector)
|
639
|
-
;
|
577
|
+
let $toggle = $(selector);
|
640
578
|
event = isFunction(module[event])
|
641
579
|
? module[event]
|
642
580
|
: module.toggle;
|
643
581
|
if ($toggle.length > 0) {
|
644
582
|
module.debug('Attaching flyout events to element', selector, event);
|
645
583
|
$toggle
|
646
|
-
.on('click' + eventNamespace, event)
|
647
|
-
;
|
584
|
+
.on('click' + eventNamespace, event);
|
648
585
|
} else {
|
649
586
|
module.error(error.notFound, selector);
|
650
587
|
}
|
@@ -723,11 +660,9 @@
|
|
723
660
|
},
|
724
661
|
|
725
662
|
hideOthers: function (callback) {
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
callbackCount = 0
|
730
|
-
;
|
663
|
+
let $otherFlyouts = $flyouts.not($module).filter('.' + className.visible);
|
664
|
+
let flyoutCount = $otherFlyouts.length;
|
665
|
+
let callbackCount = 0;
|
731
666
|
callback = callback || function () {};
|
732
667
|
$otherFlyouts
|
733
668
|
.flyout('hide', function () {
|
@@ -735,8 +670,7 @@
|
|
735
670
|
if (callbackCount === flyoutCount) {
|
736
671
|
callback();
|
737
672
|
}
|
738
|
-
})
|
739
|
-
;
|
673
|
+
});
|
740
674
|
},
|
741
675
|
|
742
676
|
toggle: function () {
|
@@ -749,11 +683,9 @@
|
|
749
683
|
},
|
750
684
|
|
751
685
|
pushPage: function (callback) {
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
transitionEnd
|
756
|
-
;
|
686
|
+
let animate;
|
687
|
+
let dim;
|
688
|
+
let transitionEnd;
|
757
689
|
callback = isFunction(callback)
|
758
690
|
? callback
|
759
691
|
: function () {};
|
@@ -787,10 +719,8 @@
|
|
787
719
|
},
|
788
720
|
|
789
721
|
pullPage: function (callback) {
|
790
|
-
|
791
|
-
|
792
|
-
transitionEnd
|
793
|
-
;
|
722
|
+
let animate;
|
723
|
+
let transitionEnd;
|
794
724
|
callback = isFunction(callback)
|
795
725
|
? callback
|
796
726
|
: function () {};
|
@@ -856,16 +786,14 @@
|
|
856
786
|
observeAttributes = state !== false;
|
857
787
|
},
|
858
788
|
autofocus: function () {
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
).first()
|
868
|
-
;
|
789
|
+
let $autofocus = $inputs.filter('[autofocus]');
|
790
|
+
let $rawInputs = $inputs.filter(':input');
|
791
|
+
let $input = ($autofocus.length > 0
|
792
|
+
? $autofocus
|
793
|
+
: ($rawInputs.length > 0
|
794
|
+
? $rawInputs
|
795
|
+
: $module)
|
796
|
+
).first();
|
869
797
|
$input.trigger('focus');
|
870
798
|
},
|
871
799
|
dimmerStyles: function () {
|
@@ -876,13 +804,11 @@
|
|
876
804
|
}
|
877
805
|
},
|
878
806
|
bodyMargin: function () {
|
879
|
-
|
807
|
+
let position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
880
808
|
$context.css((isBody ? 'margin-' : 'padding-') + position, tempBodyMargin + 'px');
|
881
809
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
882
|
-
|
883
|
-
|
884
|
-
attribute = el.css('position') === 'fixed' ? 'padding-' + position : position
|
885
|
-
;
|
810
|
+
let el = $(this);
|
811
|
+
let attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
886
812
|
el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
|
887
813
|
});
|
888
814
|
},
|
@@ -932,8 +858,7 @@
|
|
932
858
|
keyboardShortcuts: function () {
|
933
859
|
module.verbose('Removing keyboard shortcuts');
|
934
860
|
$document
|
935
|
-
.off('keydown' + eventNamespace)
|
936
|
-
;
|
861
|
+
.off('keydown' + eventNamespace);
|
937
862
|
},
|
938
863
|
|
939
864
|
// context
|
@@ -994,7 +919,7 @@
|
|
994
919
|
can: {
|
995
920
|
leftBodyScrollbar: function () {
|
996
921
|
if (module.cache.leftBodyScrollbar === undefined) {
|
997
|
-
module.cache.leftBodyScrollbar = module.is.rtl() && ((module.is.iframe && !module.is.firefox()) || module.is.safari()
|
922
|
+
module.cache.leftBodyScrollbar = module.is.rtl() && ((module.is.iframe && !module.is.firefox()) || module.is.safari());
|
998
923
|
}
|
999
924
|
|
1000
925
|
return module.cache.leftBodyScrollbar;
|
@@ -1003,20 +928,16 @@
|
|
1003
928
|
|
1004
929
|
save: {
|
1005
930
|
focus: function () {
|
1006
|
-
|
1007
|
-
|
1008
|
-
inCurrentFlyout = $activeElement.closest($module).length > 0
|
1009
|
-
;
|
931
|
+
let $activeElement = $(document.activeElement);
|
932
|
+
let inCurrentFlyout = $activeElement.closest($module).length > 0;
|
1010
933
|
if (!inCurrentFlyout) {
|
1011
934
|
$focusedElement = $(document.activeElement).trigger('blur');
|
1012
935
|
}
|
1013
936
|
},
|
1014
937
|
bodyMargin: function () {
|
1015
938
|
initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
|
1016
|
-
|
1017
|
-
|
1018
|
-
bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth
|
1019
|
-
;
|
939
|
+
let bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10);
|
940
|
+
let bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
|
1020
941
|
tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
|
1021
942
|
},
|
1022
943
|
},
|
@@ -1029,13 +950,6 @@
|
|
1029
950
|
|
1030
951
|
return module.cache.isSafari;
|
1031
952
|
},
|
1032
|
-
edge: function () {
|
1033
|
-
if (module.cache.isEdge === undefined) {
|
1034
|
-
module.cache.isEdge = !!window.setImmediate && !module.is.ie();
|
1035
|
-
}
|
1036
|
-
|
1037
|
-
return module.cache.isEdge;
|
1038
|
-
},
|
1039
953
|
firefox: function () {
|
1040
954
|
if (module.cache.isFirefox === undefined) {
|
1041
955
|
module.cache.isFirefox = !!window.InstallTrigger;
|
@@ -1046,22 +960,9 @@
|
|
1046
960
|
iframe: function () {
|
1047
961
|
return !(self === top);
|
1048
962
|
},
|
1049
|
-
ie: function () {
|
1050
|
-
if (module.cache.isIE === undefined) {
|
1051
|
-
var
|
1052
|
-
isIE11 = !window.ActiveXObject && 'ActiveXObject' in window,
|
1053
|
-
isIE = 'ActiveXObject' in window
|
1054
|
-
;
|
1055
|
-
module.cache.isIE = isIE11 || isIE;
|
1056
|
-
}
|
1057
|
-
|
1058
|
-
return module.cache.isIE;
|
1059
|
-
},
|
1060
963
|
mobile: function () {
|
1061
|
-
|
1062
|
-
|
1063
|
-
isMobile = userAgent.match(regExp.mobile)
|
1064
|
-
;
|
964
|
+
let userAgent = navigator.userAgent;
|
965
|
+
let isMobile = userAgent.match(regExp.mobile);
|
1065
966
|
if (isMobile) {
|
1066
967
|
module.verbose('Browser was found to be mobile', userAgent);
|
1067
968
|
|
@@ -1106,47 +1007,31 @@
|
|
1106
1007
|
}
|
1107
1008
|
},
|
1108
1009
|
bodyMargin: function () {
|
1109
|
-
|
1010
|
+
let position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
1110
1011
|
$context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMargin);
|
1111
1012
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
1112
|
-
|
1113
|
-
|
1114
|
-
attribute = el.css('position') === 'fixed' ? 'padding-' + position : position
|
1115
|
-
;
|
1013
|
+
let el = $(this);
|
1014
|
+
let attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
1116
1015
|
el.css(attribute, '');
|
1117
1016
|
});
|
1118
1017
|
},
|
1119
1018
|
},
|
1120
1019
|
|
1121
1020
|
helpers: {
|
1122
|
-
|
1123
|
-
|
1124
|
-
},
|
1125
|
-
escape: function (string, preserveHTML) {
|
1126
|
-
if (preserveHTML) {
|
1021
|
+
escape: function (string, settings) {
|
1022
|
+
if (settings !== undefined && settings.preserveHTML) {
|
1127
1023
|
return string;
|
1128
1024
|
}
|
1129
|
-
var
|
1130
|
-
badChars = /["'<>`]/g,
|
1131
|
-
shouldEscape = /["&'<>`]/,
|
1132
|
-
escape = {
|
1133
|
-
'<': '<',
|
1134
|
-
'>': '>',
|
1135
|
-
'"': '"',
|
1136
|
-
"'": ''',
|
1137
|
-
'`': '`',
|
1138
|
-
},
|
1139
|
-
escapedChar = function (chr) {
|
1140
|
-
return escape[chr];
|
1141
|
-
}
|
1142
|
-
;
|
1143
|
-
if (shouldEscape.test(string)) {
|
1144
|
-
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
1145
1025
|
|
1146
|
-
|
1147
|
-
|
1026
|
+
const escapeMap = {
|
1027
|
+
'"': '"',
|
1028
|
+
'&': '&',
|
1029
|
+
"'": ''',
|
1030
|
+
'<': '<',
|
1031
|
+
'>': '>',
|
1032
|
+
};
|
1148
1033
|
|
1149
|
-
return string;
|
1034
|
+
return String(string).replace(/["&'<>]/g, (chr) => escapeMap[chr]);
|
1150
1035
|
},
|
1151
1036
|
},
|
1152
1037
|
|
@@ -1201,11 +1086,9 @@
|
|
1201
1086
|
},
|
1202
1087
|
performance: {
|
1203
1088
|
log: function (message) {
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
previousTime
|
1208
|
-
;
|
1089
|
+
let currentTime;
|
1090
|
+
let executionTime;
|
1091
|
+
let previousTime;
|
1209
1092
|
if (settings.performance) {
|
1210
1093
|
currentTime = Date.now();
|
1211
1094
|
previousTime = time || currentTime;
|
@@ -1224,10 +1107,8 @@
|
|
1224
1107
|
}, 500);
|
1225
1108
|
},
|
1226
1109
|
display: function () {
|
1227
|
-
|
1228
|
-
|
1229
|
-
totalTime = 0
|
1230
|
-
;
|
1110
|
+
let title = settings.name + ':';
|
1111
|
+
let totalTime = 0;
|
1231
1112
|
time = false;
|
1232
1113
|
clearTimeout(module.performance.timer);
|
1233
1114
|
$.each(performance, function (index, data) {
|
@@ -1249,22 +1130,19 @@
|
|
1249
1130
|
},
|
1250
1131
|
},
|
1251
1132
|
invoke: function (query, passedArguments, context) {
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
response
|
1257
|
-
;
|
1133
|
+
let object = instance;
|
1134
|
+
let maxDepth;
|
1135
|
+
let found;
|
1136
|
+
let response;
|
1258
1137
|
passedArguments = passedArguments || queryArguments;
|
1259
1138
|
context = element || context;
|
1260
1139
|
if (typeof query === 'string' && object !== undefined) {
|
1261
1140
|
query = query.split(/[ .]/);
|
1262
1141
|
maxDepth = query.length - 1;
|
1263
1142
|
$.each(query, function (depth, value) {
|
1264
|
-
|
1143
|
+
let camelCaseValue = depth !== maxDepth
|
1265
1144
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
1266
|
-
: query
|
1267
|
-
;
|
1145
|
+
: query;
|
1268
1146
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
1269
1147
|
object = object[camelCaseValue];
|
1270
1148
|
} else if (object[camelCaseValue] !== undefined) {
|
@@ -1366,7 +1244,7 @@
|
|
1366
1244
|
classActions: '',
|
1367
1245
|
closeIcon: false,
|
1368
1246
|
actions: false,
|
1369
|
-
preserveHTML:
|
1247
|
+
preserveHTML: false,
|
1370
1248
|
|
1371
1249
|
fields: {
|
1372
1250
|
class: 'class',
|
@@ -1456,7 +1334,7 @@
|
|
1456
1334
|
|
1457
1335
|
$.fn.flyout.settings.templates = {
|
1458
1336
|
getArguments: function (args) {
|
1459
|
-
|
1337
|
+
let queryArguments = [].slice.call(args);
|
1460
1338
|
if ($.isPlainObject(queryArguments[0])) {
|
1461
1339
|
return $.extend({
|
1462
1340
|
handler: function () {},
|
@@ -1475,10 +1353,8 @@
|
|
1475
1353
|
};
|
1476
1354
|
},
|
1477
1355
|
alert: function () {
|
1478
|
-
|
1479
|
-
|
1480
|
-
args = settings.templates.getArguments(arguments)
|
1481
|
-
;
|
1356
|
+
let settings = this.get.settings();
|
1357
|
+
let args = settings.templates.getArguments(arguments);
|
1482
1358
|
|
1483
1359
|
return {
|
1484
1360
|
title: args.title,
|
@@ -1491,10 +1367,8 @@
|
|
1491
1367
|
};
|
1492
1368
|
},
|
1493
1369
|
confirm: function () {
|
1494
|
-
|
1495
|
-
|
1496
|
-
args = settings.templates.getArguments(arguments)
|
1497
|
-
;
|
1370
|
+
let settings = this.get.settings();
|
1371
|
+
let args = settings.templates.getArguments(arguments);
|
1498
1372
|
|
1499
1373
|
return {
|
1500
1374
|
title: args.title,
|
@@ -1515,14 +1389,12 @@
|
|
1515
1389
|
};
|
1516
1390
|
},
|
1517
1391
|
prompt: function () {
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
input = $($.parseHTML(args.content)).filter('.ui.input')
|
1523
|
-
;
|
1392
|
+
let $this = this;
|
1393
|
+
let settings = this.get.settings();
|
1394
|
+
let args = settings.templates.getArguments(arguments);
|
1395
|
+
let input = $($.parseHTML(args.content)).filter('.ui.input');
|
1524
1396
|
if (input.length === 0) {
|
1525
|
-
args.content += '<p><div class="' + settings.className.prompt + '"><input placeholder="' + this.helpers.
|
1397
|
+
args.content += '<p><div class="' + settings.className.prompt + '"><input placeholder="' + this.helpers.escape(args.placeholder || '') + '" type="text" value="' + this.helpers.escape(args.defaultValue || '') + '"></div></p>';
|
1526
1398
|
}
|
1527
1399
|
|
1528
1400
|
return {
|
@@ -1532,10 +1404,8 @@
|
|
1532
1404
|
text: settings.text.ok,
|
1533
1405
|
class: settings.className.ok,
|
1534
1406
|
click: function () {
|
1535
|
-
|
1536
|
-
|
1537
|
-
inputField = $this.get.element().find(settings.selector.prompt)[0]
|
1538
|
-
;
|
1407
|
+
let settings = $this.get.settings();
|
1408
|
+
let inputField = $this.get.element().find(settings.selector.prompt)[0];
|
1539
1409
|
args.handler($(inputField).val());
|
1540
1410
|
},
|
1541
1411
|
}, {
|