fomantic-ui 2.10.0-beta.7 → 2.10.0-beta.70
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 -33
- 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 +11 -8
- package/changelog-setup.js +88 -72
- package/changelog-template.hbs +256 -251
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +116 -164
- 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 +190 -303
- 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 +5 -6
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +3 -3
- package/dist/components/calendar.js +397 -482
- 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 -1
- package/dist/components/checkbox.js +105 -166
- 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 +2 -2
- package/dist/components/dimmer.js +75 -121
- package/dist/components/dimmer.min.css +2 -2
- 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 +21 -35
- package/dist/components/dropdown.js +775 -1161
- 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 +95 -146
- 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 +1 -1
- package/dist/components/flyout.js +242 -336
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +3 -5
- package/dist/components/form.js +425 -554
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- 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 +274 -369
- 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 +109 -153
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- 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 +210 -303
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +4 -13
- package/dist/components/progress.js +128 -185
- package/dist/components/progress.min.css +2 -2
- 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 +92 -145
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- 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 +311 -425
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +2 -2
- 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 +173 -249
- 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 +138 -199
- 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 +59 -99
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +267 -364
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +88 -132
- 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 +4 -4
- package/dist/components/step.min.css +2 -2
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +163 -228
- 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 +192 -287
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- 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 +118 -155
- 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 +114 -193
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +175 -271
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +4479 -8221
- package/dist/semantic.js +5023 -7182
- 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 +4 -5
- package/scripts/nightly-version.js +11 -14
- package/src/definitions/behaviors/api.js +189 -302
- package/src/definitions/behaviors/form.js +426 -555
- package/src/definitions/behaviors/state.js +87 -131
- package/src/definitions/behaviors/visibility.js +174 -270
- 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 +58 -98
- package/src/definitions/globals/site.less +0 -1
- package/src/definitions/modules/accordion.js +115 -163
- package/src/definitions/modules/accordion.less +0 -1
- package/src/definitions/modules/calendar.js +396 -481
- package/src/definitions/modules/calendar.less +2 -3
- package/src/definitions/modules/checkbox.js +104 -165
- package/src/definitions/modules/checkbox.less +0 -1
- package/src/definitions/modules/dimmer.js +74 -120
- package/src/definitions/modules/dimmer.less +1 -2
- package/src/definitions/modules/dropdown.js +774 -1160
- package/src/definitions/modules/dropdown.less +27 -38
- package/src/definitions/modules/embed.js +94 -145
- package/src/definitions/modules/embed.less +0 -1
- package/src/definitions/modules/flyout.js +241 -335
- package/src/definitions/modules/flyout.less +0 -1
- package/src/definitions/modules/modal.js +273 -368
- package/src/definitions/modules/modal.less +3 -4
- package/src/definitions/modules/nag.js +108 -152
- package/src/definitions/modules/nag.less +0 -1
- package/src/definitions/modules/popup.js +209 -302
- package/src/definitions/modules/popup.less +18 -73
- package/src/definitions/modules/progress.js +127 -184
- package/src/definitions/modules/progress.less +3 -13
- package/src/definitions/modules/rating.js +93 -146
- package/src/definitions/modules/rating.less +0 -1
- package/src/definitions/modules/search.js +312 -426
- package/src/definitions/modules/search.less +2 -4
- package/src/definitions/modules/shape.js +172 -248
- package/src/definitions/modules/shape.less +0 -1
- package/src/definitions/modules/sidebar.js +137 -198
- package/src/definitions/modules/sidebar.less +0 -1
- package/src/definitions/modules/slider.js +266 -363
- package/src/definitions/modules/slider.less +0 -1
- package/src/definitions/modules/sticky.js +162 -227
- package/src/definitions/modules/sticky.less +0 -1
- package/src/definitions/modules/tab.js +191 -286
- package/src/definitions/modules/tab.less +0 -1
- package/src/definitions/modules/toast.js +117 -154
- package/src/definitions/modules/toast.less +0 -1
- package/src/definitions/modules/transition.js +113 -192
- 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 +87 -110
- package/tasks/admin/components/init.js +26 -33
- package/tasks/admin/components/update.js +46 -54
- package/tasks/admin/distributions/create.js +74 -125
- package/tasks/admin/distributions/init.js +27 -34
- package/tasks/admin/distributions/update.js +45 -53
- package/tasks/admin/register.js +11 -15
- package/tasks/build/assets.js +14 -18
- package/tasks/build/css.js +59 -68
- package/tasks/build/javascript.js +46 -54
- package/tasks/build.js +4 -6
- package/tasks/check-install.js +5 -7
- package/tasks/clean.js +2 -4
- package/tasks/collections/admin.js +13 -15
- package/tasks/collections/build.js +6 -8
- package/tasks/collections/docs.js +2 -4
- 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 +8 -10
- package/tasks/config/admin/templates/css-package.js +1 -3
- package/tasks/config/admin/templates/less-package.js +1 -3
- package/tasks/config/npm/gulpfile.js +4 -6
- package/tasks/config/project/config.js +26 -34
- package/tasks/config/project/install.js +58 -72
- package/tasks/config/project/release.js +7 -15
- package/tasks/config/tasks.js +23 -24
- package/tasks/config/user.js +9 -16
- package/tasks/docs/build.js +26 -31
- package/tasks/docs/metadata.js +35 -43
- package/tasks/docs/serve.js +20 -26
- package/tasks/install.js +77 -102
- package/tasks/rtl/build.js +2 -4
- package/tasks/rtl/watch.js +2 -4
- package/tasks/watch.js +9 -11
- package/test/meteor/assets.js +4 -4
- package/test/meteor/fonts.js +11 -13
- package/test/modules/module.spec.js +25 -27
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* # Fomantic-UI 2.10.0-beta.
|
|
2
|
+
* # Fomantic-UI 2.10.0-beta.70+88a499a - Sidebar
|
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -19,74 +19,70 @@
|
|
|
19
19
|
? window
|
|
20
20
|
: globalThis;
|
|
21
21
|
|
|
22
|
-
$.fn.sidebar = function (
|
|
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
|
-
}
|
|
22
|
+
$.fn.sidebar = function (...args) {
|
|
23
|
+
const $allModules = $(this);
|
|
24
|
+
const $window = $(window);
|
|
25
|
+
const $document = $(document);
|
|
26
|
+
const $body = $('body');
|
|
27
|
+
const $html = $('html');
|
|
28
|
+
const $head = $('head');
|
|
29
|
+
|
|
30
|
+
let time = Date.now();
|
|
31
|
+
let performance = [];
|
|
32
|
+
|
|
33
|
+
const parameters = args[0];
|
|
34
|
+
const methodInvoked = typeof parameters === 'string';
|
|
35
|
+
const queryArguments = args.slice(1);
|
|
36
|
+
const contextCheck = function (context, win) {
|
|
37
|
+
let $context;
|
|
38
|
+
if ([window, document].includes(context)) {
|
|
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
|
-
|
|
47
|
+
return $context;
|
|
48
|
+
};
|
|
49
|
+
let returnedValue;
|
|
51
50
|
|
|
52
51
|
$allModules.each(function () {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
: $.extend({}, $.fn.sidebar.settings),
|
|
57
|
-
|
|
58
|
-
selector = settings.selector,
|
|
59
|
-
className = settings.className,
|
|
60
|
-
namespace = settings.namespace,
|
|
61
|
-
regExp = settings.regExp,
|
|
62
|
-
error = settings.error,
|
|
52
|
+
const settings = $.isPlainObject(parameters)
|
|
53
|
+
? $.extend(true, {}, $.fn.sidebar.settings, parameters)
|
|
54
|
+
: $.extend({}, $.fn.sidebar.settings);
|
|
63
55
|
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
const selector = settings.selector;
|
|
57
|
+
const className = settings.className;
|
|
58
|
+
const namespace = settings.namespace;
|
|
59
|
+
const regExp = settings.regExp;
|
|
60
|
+
const error = settings.error;
|
|
66
61
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
isBody = $context[0] === $body[0],
|
|
62
|
+
const eventNamespace = '.' + namespace;
|
|
63
|
+
const moduleNamespace = 'module-' + namespace;
|
|
70
64
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
$style,
|
|
65
|
+
const $module = $(this);
|
|
66
|
+
let $context = contextCheck(settings.context, window);
|
|
67
|
+
const isBody = $context[0] === $body[0];
|
|
75
68
|
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
let $sidebars = $module.children(selector.sidebar);
|
|
70
|
+
let $fixed = $context.children(selector.fixed);
|
|
71
|
+
let $pusher = $context.children(selector.pusher);
|
|
72
|
+
let $style;
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
currentScroll,
|
|
82
|
-
initialBodyMargin = '',
|
|
83
|
-
tempBodyMargin = '',
|
|
84
|
-
hadScrollbar = false,
|
|
74
|
+
const element = this;
|
|
75
|
+
let instance = $module.data(moduleNamespace);
|
|
85
76
|
|
|
86
|
-
|
|
87
|
-
;
|
|
77
|
+
let elementNamespace;
|
|
78
|
+
let id;
|
|
79
|
+
let currentScroll;
|
|
80
|
+
let initialBodyMargin = '';
|
|
81
|
+
let initialBodyMarginInt = 0;
|
|
82
|
+
let tempBodyMargin = 0;
|
|
83
|
+
let hadScrollbar = false;
|
|
88
84
|
|
|
89
|
-
module = {
|
|
85
|
+
const module = {
|
|
90
86
|
|
|
91
87
|
initialize: function () {
|
|
92
88
|
module.debug('Initializing sidebar', parameters);
|
|
@@ -111,8 +107,7 @@
|
|
|
111
107
|
module.verbose('Storing instance of module', module);
|
|
112
108
|
instance = module;
|
|
113
109
|
$module
|
|
114
|
-
.data(moduleNamespace, module)
|
|
115
|
-
;
|
|
110
|
+
.data(moduleNamespace, module);
|
|
116
111
|
},
|
|
117
112
|
|
|
118
113
|
create: {
|
|
@@ -127,8 +122,7 @@
|
|
|
127
122
|
module.verbose('Destroying previous module for', $module);
|
|
128
123
|
$module
|
|
129
124
|
.off(eventNamespace)
|
|
130
|
-
.removeData(moduleNamespace)
|
|
131
|
-
;
|
|
125
|
+
.removeData(moduleNamespace);
|
|
132
126
|
// bound by uuid
|
|
133
127
|
$context.off(elementNamespace);
|
|
134
128
|
$window.off(elementNamespace);
|
|
@@ -138,10 +132,8 @@
|
|
|
138
132
|
event: {
|
|
139
133
|
clickaway: function (event) {
|
|
140
134
|
if (settings.closable) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
clickedContext = $context.is(event.target)
|
|
144
|
-
;
|
|
135
|
+
const clickedInPusher = $pusher.find(event.target).length > 0 || $pusher.is(event.target);
|
|
136
|
+
const clickedContext = $context.is(event.target);
|
|
145
137
|
if (clickedInPusher) {
|
|
146
138
|
module.verbose('User clicked on dimmed page');
|
|
147
139
|
module.hide();
|
|
@@ -175,8 +167,7 @@
|
|
|
175
167
|
module.verbose('Adding clickaway events to context', $context);
|
|
176
168
|
$context
|
|
177
169
|
.on('click' + elementNamespace, module.event.clickaway)
|
|
178
|
-
.on('touchend' + elementNamespace, module.event.clickaway)
|
|
179
|
-
;
|
|
170
|
+
.on('touchend' + elementNamespace, module.event.clickaway);
|
|
180
171
|
},
|
|
181
172
|
scrollLock: function () {
|
|
182
173
|
if (settings.scrollLock) {
|
|
@@ -190,11 +181,9 @@
|
|
|
190
181
|
}
|
|
191
182
|
module.verbose('Adding events to contain sidebar scroll');
|
|
192
183
|
$document
|
|
193
|
-
.on('touchmove' + elementNamespace, module.event.touch)
|
|
194
|
-
;
|
|
184
|
+
.on('touchmove' + elementNamespace, module.event.touch);
|
|
195
185
|
$module
|
|
196
|
-
.on('scroll' + eventNamespace, module.event.containScroll)
|
|
197
|
-
;
|
|
186
|
+
.on('scroll' + eventNamespace, module.event.containScroll);
|
|
198
187
|
},
|
|
199
188
|
},
|
|
200
189
|
unbind: {
|
|
@@ -215,19 +204,17 @@
|
|
|
215
204
|
|
|
216
205
|
add: {
|
|
217
206
|
inlineCSS: function () {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
style
|
|
230
|
-
;
|
|
207
|
+
const width = module.cache.width || $module.outerWidth();
|
|
208
|
+
const height = module.cache.height || $module.outerHeight();
|
|
209
|
+
const isRTL = module.is.rtl();
|
|
210
|
+
const direction = module.get.direction();
|
|
211
|
+
const distance = {
|
|
212
|
+
left: width,
|
|
213
|
+
right: -width,
|
|
214
|
+
top: height,
|
|
215
|
+
bottom: -height,
|
|
216
|
+
};
|
|
217
|
+
let style;
|
|
231
218
|
|
|
232
219
|
if (isRTL) {
|
|
233
220
|
module.verbose('RTL detected, flipping widths');
|
|
@@ -254,8 +241,7 @@
|
|
|
254
241
|
|
|
255
242
|
style += '</style>';
|
|
256
243
|
$style = $(style)
|
|
257
|
-
.appendTo($head)
|
|
258
|
-
;
|
|
244
|
+
.appendTo($head);
|
|
259
245
|
module.debug('Adding sizing css to head', $style);
|
|
260
246
|
},
|
|
261
247
|
},
|
|
@@ -277,7 +263,7 @@
|
|
|
277
263
|
repaint: function () {
|
|
278
264
|
module.verbose('Forcing repaint event');
|
|
279
265
|
element.style.display = 'none';
|
|
280
|
-
|
|
266
|
+
const ignored = element.offsetHeight;
|
|
281
267
|
element.scrollTop = element.scrollTop; // eslint-disable-line no-self-assign
|
|
282
268
|
element.style.display = '';
|
|
283
269
|
},
|
|
@@ -298,8 +284,7 @@
|
|
|
298
284
|
.children()
|
|
299
285
|
.not(selector.omitted)
|
|
300
286
|
.not($sidebars)
|
|
301
|
-
.wrapAll($pusher)
|
|
302
|
-
;
|
|
287
|
+
.wrapAll($pusher);
|
|
303
288
|
module.refresh();
|
|
304
289
|
}
|
|
305
290
|
if ($module.nextAll(selector.pusher).length === 0 || $module.nextAll(selector.pusher)[0] !== $pusher[0]) {
|
|
@@ -315,17 +300,14 @@
|
|
|
315
300
|
},
|
|
316
301
|
|
|
317
302
|
attachEvents: function (selector, event) {
|
|
318
|
-
|
|
319
|
-
$toggle = $(selector)
|
|
320
|
-
;
|
|
303
|
+
const $toggle = $(selector);
|
|
321
304
|
event = isFunction(module[event])
|
|
322
305
|
? module[event]
|
|
323
306
|
: module.toggle;
|
|
324
307
|
if ($toggle.length > 0) {
|
|
325
308
|
module.debug('Attaching sidebar events to element', selector, event);
|
|
326
309
|
$toggle
|
|
327
|
-
.on('click' + eventNamespace, event)
|
|
328
|
-
;
|
|
310
|
+
.on('click' + eventNamespace, event);
|
|
329
311
|
} else {
|
|
330
312
|
module.error(error.notFound, selector);
|
|
331
313
|
}
|
|
@@ -342,11 +324,9 @@
|
|
|
342
324
|
save: {
|
|
343
325
|
bodyMargin: function () {
|
|
344
326
|
initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
;
|
|
349
|
-
tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
|
|
327
|
+
initialBodyMarginInt = Number.parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10);
|
|
328
|
+
const bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
|
|
329
|
+
tempBodyMargin = initialBodyMarginInt + bodyScrollbarWidth;
|
|
350
330
|
},
|
|
351
331
|
},
|
|
352
332
|
show: function (callback) {
|
|
@@ -415,21 +395,17 @@
|
|
|
415
395
|
return module.othersVisible() || module.othersAnimating();
|
|
416
396
|
},
|
|
417
397
|
|
|
418
|
-
hideOthers: function (callback) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
callbackCount = 0
|
|
423
|
-
;
|
|
424
|
-
callback = callback || function () {};
|
|
398
|
+
hideOthers: function (callback = function () {}) {
|
|
399
|
+
const $otherSidebars = $sidebars.not($module).filter('.' + className.visible);
|
|
400
|
+
const sidebarCount = $otherSidebars.length;
|
|
401
|
+
let callbackCount = 0;
|
|
425
402
|
$otherSidebars
|
|
426
403
|
.sidebar('hide', function () {
|
|
427
404
|
callbackCount++;
|
|
428
|
-
if (callbackCount === sidebarCount) {
|
|
405
|
+
if (callbackCount === sidebarCount && isFunction(callback)) {
|
|
429
406
|
callback();
|
|
430
407
|
}
|
|
431
|
-
})
|
|
432
|
-
;
|
|
408
|
+
});
|
|
433
409
|
},
|
|
434
410
|
|
|
435
411
|
toggle: function () {
|
|
@@ -442,15 +418,10 @@
|
|
|
442
418
|
},
|
|
443
419
|
|
|
444
420
|
pushPage: function (callback) {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
$
|
|
448
|
-
|
|
449
|
-
: $pusher,
|
|
450
|
-
animate,
|
|
451
|
-
dim,
|
|
452
|
-
transitionEnd
|
|
453
|
-
;
|
|
421
|
+
const transition = module.get.transition();
|
|
422
|
+
const $transition = transition === 'overlay' || module.othersActive()
|
|
423
|
+
? $module
|
|
424
|
+
: $pusher;
|
|
454
425
|
callback = isFunction(callback)
|
|
455
426
|
? callback
|
|
456
427
|
: function () {};
|
|
@@ -463,16 +434,16 @@
|
|
|
463
434
|
module.bind.scrollLock();
|
|
464
435
|
module.set.transition(transition);
|
|
465
436
|
module.repaint();
|
|
466
|
-
animate = function () {
|
|
437
|
+
const animate = function () {
|
|
467
438
|
module.bind.clickaway();
|
|
468
439
|
module.add.inlineCSS();
|
|
469
440
|
module.set.animating();
|
|
470
441
|
module.set.visible();
|
|
471
442
|
};
|
|
472
|
-
dim = function () {
|
|
443
|
+
const dim = function () {
|
|
473
444
|
module.set.dimmed();
|
|
474
445
|
};
|
|
475
|
-
transitionEnd = function (event) {
|
|
446
|
+
const transitionEnd = function (event) {
|
|
476
447
|
if (event.target === $transition[0]) {
|
|
477
448
|
$transition.off('transitionend' + elementNamespace, transitionEnd);
|
|
478
449
|
module.remove.animating();
|
|
@@ -488,14 +459,10 @@
|
|
|
488
459
|
},
|
|
489
460
|
|
|
490
461
|
pullPage: function (callback) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
$
|
|
494
|
-
|
|
495
|
-
: $pusher,
|
|
496
|
-
animate,
|
|
497
|
-
transitionEnd
|
|
498
|
-
;
|
|
462
|
+
const transition = module.get.transition();
|
|
463
|
+
const $transition = transition === 'overlay' || module.othersActive()
|
|
464
|
+
? $module
|
|
465
|
+
: $pusher;
|
|
499
466
|
callback = isFunction(callback)
|
|
500
467
|
? callback
|
|
501
468
|
: function () {};
|
|
@@ -504,7 +471,7 @@
|
|
|
504
471
|
module.unbind.clickaway();
|
|
505
472
|
module.unbind.scrollLock();
|
|
506
473
|
|
|
507
|
-
animate = function () {
|
|
474
|
+
const animate = function () {
|
|
508
475
|
module.set.transition(transition);
|
|
509
476
|
module.set.animating();
|
|
510
477
|
if (settings.dimPage && !module.othersVisible()) {
|
|
@@ -512,7 +479,7 @@
|
|
|
512
479
|
}
|
|
513
480
|
module.remove.visible();
|
|
514
481
|
};
|
|
515
|
-
transitionEnd = function (event) {
|
|
482
|
+
const transitionEnd = function (event) {
|
|
516
483
|
if (event.target === $transition[0]) {
|
|
517
484
|
$transition.off('transitionend' + elementNamespace, transitionEnd);
|
|
518
485
|
module.remove.animating();
|
|
@@ -553,13 +520,11 @@
|
|
|
553
520
|
|
|
554
521
|
set: {
|
|
555
522
|
bodyMargin: function () {
|
|
556
|
-
|
|
523
|
+
const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
|
557
524
|
$context.css((isBody ? 'margin-' : 'padding-') + position, tempBodyMargin + 'px');
|
|
558
525
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
attribute = el.css('position') === 'fixed' ? 'padding-' + position : position
|
|
562
|
-
;
|
|
526
|
+
const el = $(this);
|
|
527
|
+
const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
|
563
528
|
el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
|
|
564
529
|
});
|
|
565
530
|
},
|
|
@@ -594,12 +559,10 @@
|
|
|
594
559
|
closing: function () {
|
|
595
560
|
$pusher.addClass(className.closing);
|
|
596
561
|
},
|
|
597
|
-
transition: function (transition) {
|
|
598
|
-
transition = transition || module.get.transition();
|
|
562
|
+
transition: function (transition = module.get.transition()) {
|
|
599
563
|
$module.addClass(transition);
|
|
600
564
|
},
|
|
601
|
-
direction: function (direction) {
|
|
602
|
-
direction = direction || module.get.direction();
|
|
565
|
+
direction: function (direction = module.get.direction()) {
|
|
603
566
|
$module.addClass(className[direction]);
|
|
604
567
|
},
|
|
605
568
|
visible: function () {
|
|
@@ -636,12 +599,10 @@
|
|
|
636
599
|
closing: function () {
|
|
637
600
|
$pusher.removeClass(className.closing);
|
|
638
601
|
},
|
|
639
|
-
transition: function (transition) {
|
|
640
|
-
transition = transition || module.get.transition();
|
|
602
|
+
transition: function (transition = module.get.transition()) {
|
|
641
603
|
$module.removeClass(transition);
|
|
642
604
|
},
|
|
643
|
-
direction: function (direction) {
|
|
644
|
-
direction = direction || module.get.direction();
|
|
605
|
+
direction: function (direction = module.get.direction()) {
|
|
645
606
|
$module.removeClass(className[direction]);
|
|
646
607
|
},
|
|
647
608
|
visible: function () {
|
|
@@ -653,13 +614,11 @@
|
|
|
653
614
|
},
|
|
654
615
|
restore: {
|
|
655
616
|
bodyMargin: function () {
|
|
656
|
-
|
|
657
|
-
$context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMargin);
|
|
617
|
+
const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
|
618
|
+
$context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMarginInt === 0 ? '' : initialBodyMargin);
|
|
658
619
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
attribute = el.css('position') === 'fixed' ? 'padding-' + position : position
|
|
662
|
-
;
|
|
620
|
+
const el = $(this);
|
|
621
|
+
const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
|
663
622
|
el.css(attribute, '');
|
|
664
623
|
});
|
|
665
624
|
},
|
|
@@ -679,11 +638,8 @@
|
|
|
679
638
|
return className.left;
|
|
680
639
|
},
|
|
681
640
|
transition: function () {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
transition
|
|
685
|
-
;
|
|
686
|
-
transition = module.is.mobile()
|
|
641
|
+
const direction = module.get.direction();
|
|
642
|
+
const transition = module.is.mobile()
|
|
687
643
|
? (settings.mobileTransition === 'auto'
|
|
688
644
|
? settings.defaultTransition.mobile[direction]
|
|
689
645
|
: settings.mobileTransition)
|
|
@@ -716,13 +672,11 @@
|
|
|
716
672
|
return module.cache.isFirefox;
|
|
717
673
|
},
|
|
718
674
|
iframe: function () {
|
|
719
|
-
return !(self === top);
|
|
675
|
+
return !(window.self === window.top);
|
|
720
676
|
},
|
|
721
677
|
mobile: function () {
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
isMobile = userAgent.match(regExp.mobile)
|
|
725
|
-
;
|
|
678
|
+
const userAgent = navigator.userAgent;
|
|
679
|
+
const isMobile = userAgent.match(regExp.mobile);
|
|
726
680
|
if (isMobile) {
|
|
727
681
|
module.verbose('Browser was found to be mobile', userAgent);
|
|
728
682
|
|
|
@@ -784,39 +738,37 @@
|
|
|
784
738
|
return module[name];
|
|
785
739
|
}
|
|
786
740
|
},
|
|
787
|
-
debug: function () {
|
|
741
|
+
debug: function (...args) {
|
|
788
742
|
if (!settings.silent && settings.debug) {
|
|
789
743
|
if (settings.performance) {
|
|
790
|
-
module.performance.log(
|
|
744
|
+
module.performance.log(args);
|
|
791
745
|
} else {
|
|
792
746
|
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
|
793
|
-
module.debug.apply(console,
|
|
747
|
+
module.debug.apply(console, args);
|
|
794
748
|
}
|
|
795
749
|
}
|
|
796
750
|
},
|
|
797
|
-
verbose: function () {
|
|
751
|
+
verbose: function (...args) {
|
|
798
752
|
if (!settings.silent && settings.verbose && settings.debug) {
|
|
799
753
|
if (settings.performance) {
|
|
800
|
-
module.performance.log(
|
|
754
|
+
module.performance.log(args);
|
|
801
755
|
} else {
|
|
802
756
|
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
|
803
|
-
module.verbose.apply(console,
|
|
757
|
+
module.verbose.apply(console, args);
|
|
804
758
|
}
|
|
805
759
|
}
|
|
806
760
|
},
|
|
807
|
-
error: function () {
|
|
761
|
+
error: function (...args) {
|
|
808
762
|
if (!settings.silent) {
|
|
809
763
|
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
|
810
|
-
module.error.apply(console,
|
|
764
|
+
module.error.apply(console, args);
|
|
811
765
|
}
|
|
812
766
|
},
|
|
813
767
|
performance: {
|
|
814
768
|
log: function (message) {
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
previousTime
|
|
819
|
-
;
|
|
769
|
+
let currentTime;
|
|
770
|
+
let executionTime;
|
|
771
|
+
let previousTime;
|
|
820
772
|
if (settings.performance) {
|
|
821
773
|
currentTime = Date.now();
|
|
822
774
|
previousTime = time || currentTime;
|
|
@@ -824,7 +776,7 @@
|
|
|
824
776
|
time = currentTime;
|
|
825
777
|
performance.push({
|
|
826
778
|
Name: message[0],
|
|
827
|
-
Arguments:
|
|
779
|
+
Arguments: message.slice(1),
|
|
828
780
|
Element: element,
|
|
829
781
|
'Execution Time': executionTime,
|
|
830
782
|
});
|
|
@@ -835,10 +787,8 @@
|
|
|
835
787
|
}, 500);
|
|
836
788
|
},
|
|
837
789
|
display: function () {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
totalTime = 0
|
|
841
|
-
;
|
|
790
|
+
let title = settings.name + ':';
|
|
791
|
+
let totalTime = 0;
|
|
842
792
|
time = false;
|
|
843
793
|
clearTimeout(module.performance.timer);
|
|
844
794
|
$.each(performance, function (index, data) {
|
|
@@ -847,35 +797,24 @@
|
|
|
847
797
|
title += ' ' + totalTime + 'ms';
|
|
848
798
|
if (performance.length > 0) {
|
|
849
799
|
console.groupCollapsed(title);
|
|
850
|
-
|
|
851
|
-
console.table(performance);
|
|
852
|
-
} else {
|
|
853
|
-
$.each(performance, function (index, data) {
|
|
854
|
-
console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
|
|
855
|
-
});
|
|
856
|
-
}
|
|
800
|
+
console.table(performance);
|
|
857
801
|
console.groupEnd();
|
|
858
802
|
}
|
|
859
803
|
performance = [];
|
|
860
804
|
},
|
|
861
805
|
},
|
|
862
|
-
invoke: function (query, passedArguments, context) {
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
response
|
|
868
|
-
;
|
|
869
|
-
passedArguments = passedArguments || queryArguments;
|
|
870
|
-
context = context || element;
|
|
806
|
+
invoke: function (query, passedArguments = queryArguments, context = element) {
|
|
807
|
+
let object = instance;
|
|
808
|
+
let maxDepth;
|
|
809
|
+
let found;
|
|
810
|
+
let response;
|
|
871
811
|
if (typeof query === 'string' && object !== undefined) {
|
|
872
812
|
query = query.split(/[ .]/);
|
|
873
813
|
maxDepth = query.length - 1;
|
|
874
814
|
$.each(query, function (depth, value) {
|
|
875
|
-
|
|
815
|
+
const camelCaseValue = depth !== maxDepth
|
|
876
816
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
877
|
-
: query
|
|
878
|
-
;
|
|
817
|
+
: query;
|
|
879
818
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
|
880
819
|
object = object[camelCaseValue];
|
|
881
820
|
} else if (object[camelCaseValue] !== undefined) {
|
|
@@ -916,7 +855,7 @@
|
|
|
916
855
|
if (instance === undefined) {
|
|
917
856
|
module.initialize();
|
|
918
857
|
}
|
|
919
|
-
module.invoke(
|
|
858
|
+
module.invoke(parameters);
|
|
920
859
|
} else {
|
|
921
860
|
if (instance !== undefined) {
|
|
922
861
|
module.invoke('destroy');
|