fomantic-ui 2.10.0-beta.62 → 2.10.0-beta.64
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 +0 -1
- package/changelog-setup.js +10 -10
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +40 -41
- 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 +57 -61
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +186 -187
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +29 -30
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +22 -23
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +293 -337
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +33 -35
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- 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 +74 -81
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +141 -146
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +1 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +80 -81
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +27 -28
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +62 -72
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +51 -55
- 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 +33 -34
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +96 -109
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +44 -45
- 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 +56 -64
- 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 +16 -17
- 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 +143 -148
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +24 -25
- 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 +42 -43
- 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 +57 -66
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +32 -33
- 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 +38 -45
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +76 -77
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +53 -53
- package/dist/semantic.js +1753 -1884
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/scripts/nightly-version.js +3 -3
- package/src/definitions/behaviors/api.js +56 -60
- package/src/definitions/behaviors/form.js +140 -145
- package/src/definitions/behaviors/state.js +23 -24
- package/src/definitions/behaviors/visibility.js +75 -76
- package/src/definitions/globals/site.js +15 -16
- package/src/definitions/modules/accordion.js +39 -40
- package/src/definitions/modules/calendar.js +185 -186
- package/src/definitions/modules/checkbox.js +28 -29
- package/src/definitions/modules/dimmer.js +21 -22
- package/src/definitions/modules/dropdown.js +292 -336
- package/src/definitions/modules/embed.js +32 -34
- package/src/definitions/modules/flyout.js +73 -80
- package/src/definitions/modules/modal.js +79 -80
- package/src/definitions/modules/nag.js +26 -27
- package/src/definitions/modules/popup.js +61 -71
- package/src/definitions/modules/progress.js +50 -54
- package/src/definitions/modules/rating.js +32 -33
- package/src/definitions/modules/search.js +95 -108
- package/src/definitions/modules/shape.js +43 -44
- package/src/definitions/modules/sidebar.js +55 -63
- package/src/definitions/modules/slider.js +142 -147
- package/src/definitions/modules/sticky.js +41 -42
- package/src/definitions/modules/tab.js +56 -65
- package/src/definitions/modules/toast.js +31 -32
- package/src/definitions/modules/transition.js +37 -44
- package/tasks/admin/components/create.js +11 -11
- package/tasks/admin/components/init.js +11 -12
- package/tasks/admin/components/update.js +19 -20
- package/tasks/admin/distributions/create.js +24 -36
- 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 +1 -1
- 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 +6 -6
- package/tasks/config/project/install.js +12 -12
- package/tasks/config/project/release.js +5 -11
- package/tasks/config/tasks.js +5 -5
- package/tasks/config/user.js +1 -4
- package/tasks/docs/metadata.js +11 -12
- package/tasks/install.js +9 -9
- package/test/meteor/assets.js +1 -1
- package/test/modules/module.spec.js +18 -18
|
@@ -20,31 +20,31 @@
|
|
|
20
20
|
: globalThis;
|
|
21
21
|
|
|
22
22
|
$.fn.shape = function (...args) {
|
|
23
|
-
|
|
23
|
+
const $allModules = $(this);
|
|
24
24
|
|
|
25
25
|
let time = Date.now();
|
|
26
26
|
let performance = [];
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const parameters = args[0];
|
|
29
|
+
const methodInvoked = typeof parameters === 'string';
|
|
30
|
+
const queryArguments = args.slice(1);
|
|
31
31
|
|
|
32
32
|
let returnedValue;
|
|
33
33
|
|
|
34
34
|
$allModules.each(function () {
|
|
35
|
-
|
|
35
|
+
const settings = $.isPlainObject(parameters)
|
|
36
36
|
? $.extend(true, {}, $.fn.shape.settings, parameters)
|
|
37
37
|
: $.extend({}, $.fn.shape.settings);
|
|
38
38
|
|
|
39
39
|
// internal aliases
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const namespace = settings.namespace;
|
|
41
|
+
const selector = settings.selector;
|
|
42
|
+
const error = settings.error;
|
|
43
|
+
const className = settings.className;
|
|
44
44
|
|
|
45
45
|
// define namespaces for modules
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const eventNamespace = '.' + namespace;
|
|
47
|
+
const moduleNamespace = 'module-' + namespace;
|
|
48
48
|
|
|
49
49
|
// selector cache
|
|
50
50
|
let $module = $(this);
|
|
@@ -57,11 +57,10 @@
|
|
|
57
57
|
let $nextSide;
|
|
58
58
|
|
|
59
59
|
// standard module
|
|
60
|
-
|
|
60
|
+
const element = this;
|
|
61
61
|
let instance = $module.data(moduleNamespace);
|
|
62
|
-
let module;
|
|
63
62
|
|
|
64
|
-
module = {
|
|
63
|
+
const module = {
|
|
65
64
|
|
|
66
65
|
initialize: function () {
|
|
67
66
|
module.verbose('Initializing module for', element);
|
|
@@ -92,8 +91,8 @@
|
|
|
92
91
|
|
|
93
92
|
repaint: function () {
|
|
94
93
|
module.verbose('Forcing repaint event');
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
const shape = $sides[0] || document.createElement('div');
|
|
95
|
+
const fakeAssignment = shape.offsetWidth;
|
|
97
96
|
},
|
|
98
97
|
|
|
99
98
|
animate: function (propertyObject, callback) {
|
|
@@ -191,9 +190,9 @@
|
|
|
191
190
|
},
|
|
192
191
|
|
|
193
192
|
currentStageSize: function () {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
const $activeSide = $side.filter('.' + className.active);
|
|
194
|
+
const width = $activeSide.outerWidth(true);
|
|
195
|
+
const height = $activeSide.outerHeight(true);
|
|
197
196
|
$module
|
|
198
197
|
.css({
|
|
199
198
|
width: width,
|
|
@@ -202,20 +201,20 @@
|
|
|
202
201
|
},
|
|
203
202
|
|
|
204
203
|
stageSize: function () {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
const $clone = $module.clone().addClass(className.loading);
|
|
205
|
+
const $side = $clone.find('>' + selector.sides + '>' + selector.side);
|
|
206
|
+
const $activeSide = $side.filter('.' + className.active);
|
|
207
|
+
const $nextSide = nextIndex
|
|
209
208
|
? $side.eq(nextIndex)
|
|
210
209
|
: ($activeSide.next(selector.side).length > 0
|
|
211
210
|
? $activeSide.next(selector.side)
|
|
212
211
|
: $side.first());
|
|
213
|
-
|
|
212
|
+
const newWidth = settings.width === 'next'
|
|
214
213
|
? $nextSide.outerWidth(true)
|
|
215
214
|
: (settings.width === 'initial'
|
|
216
215
|
? $module.width()
|
|
217
216
|
: settings.width);
|
|
218
|
-
|
|
217
|
+
const newHeight = settings.height === 'next'
|
|
219
218
|
? $nextSide.outerHeight(true)
|
|
220
219
|
: (settings.height === 'initial'
|
|
221
220
|
? $module.height()
|
|
@@ -268,7 +267,7 @@
|
|
|
268
267
|
|
|
269
268
|
return;
|
|
270
269
|
}
|
|
271
|
-
|
|
270
|
+
const transform = module.get.transform[type]();
|
|
272
271
|
if (!module.is.animating()) {
|
|
273
272
|
module.debug('Flipping ' + type, $nextSide);
|
|
274
273
|
module.set.stageSize();
|
|
@@ -309,8 +308,8 @@
|
|
|
309
308
|
|
|
310
309
|
transform: {
|
|
311
310
|
up: function () {
|
|
312
|
-
|
|
313
|
-
|
|
311
|
+
const translateZ = $activeSide.outerHeight(true) / 2;
|
|
312
|
+
const translateY = $nextSide.outerHeight(true) - translateZ;
|
|
314
313
|
|
|
315
314
|
return {
|
|
316
315
|
transform: 'translateY(' + translateY + 'px) translateZ(-' + translateZ + 'px) rotateX(-90deg)',
|
|
@@ -318,7 +317,7 @@
|
|
|
318
317
|
},
|
|
319
318
|
|
|
320
319
|
down: function () {
|
|
321
|
-
|
|
320
|
+
const translate = {
|
|
322
321
|
z: $activeSide.outerHeight(true) / 2,
|
|
323
322
|
};
|
|
324
323
|
|
|
@@ -328,8 +327,8 @@
|
|
|
328
327
|
},
|
|
329
328
|
|
|
330
329
|
left: function () {
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
const translateZ = $activeSide.outerWidth(true) / 2;
|
|
331
|
+
const translateX = $nextSide.outerWidth(true) - translateZ;
|
|
333
332
|
|
|
334
333
|
return {
|
|
335
334
|
transform: 'translateX(' + translateX + 'px) translateZ(-' + translateZ + 'px) rotateY(90deg)',
|
|
@@ -337,7 +336,7 @@
|
|
|
337
336
|
},
|
|
338
337
|
|
|
339
338
|
right: function () {
|
|
340
|
-
|
|
339
|
+
const translate = {
|
|
341
340
|
z: $activeSide.outerWidth(true) / 2,
|
|
342
341
|
};
|
|
343
342
|
|
|
@@ -347,7 +346,7 @@
|
|
|
347
346
|
},
|
|
348
347
|
|
|
349
348
|
over: function () {
|
|
350
|
-
|
|
349
|
+
const translate = {
|
|
351
350
|
x: -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2),
|
|
352
351
|
};
|
|
353
352
|
|
|
@@ -357,7 +356,7 @@
|
|
|
357
356
|
},
|
|
358
357
|
|
|
359
358
|
back: function () {
|
|
360
|
-
|
|
359
|
+
const translate = {
|
|
361
360
|
x: -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2),
|
|
362
361
|
};
|
|
363
362
|
|
|
@@ -378,7 +377,7 @@
|
|
|
378
377
|
stage: {
|
|
379
378
|
|
|
380
379
|
above: function () {
|
|
381
|
-
|
|
380
|
+
const box = {
|
|
382
381
|
origin: ($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2,
|
|
383
382
|
depth: {
|
|
384
383
|
active: $nextSide.outerHeight(true) / 2,
|
|
@@ -399,7 +398,7 @@
|
|
|
399
398
|
},
|
|
400
399
|
|
|
401
400
|
below: function () {
|
|
402
|
-
|
|
401
|
+
const box = {
|
|
403
402
|
origin: ($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2,
|
|
404
403
|
depth: {
|
|
405
404
|
active: $nextSide.outerHeight(true) / 2,
|
|
@@ -420,11 +419,11 @@
|
|
|
420
419
|
},
|
|
421
420
|
|
|
422
421
|
left: function () {
|
|
423
|
-
|
|
422
|
+
const height = {
|
|
424
423
|
active: $activeSide.outerWidth(true),
|
|
425
424
|
next: $nextSide.outerWidth(true),
|
|
426
425
|
};
|
|
427
|
-
|
|
426
|
+
const box = {
|
|
428
427
|
origin: (height.active - height.next) / 2,
|
|
429
428
|
depth: {
|
|
430
429
|
active: height.next / 2,
|
|
@@ -445,11 +444,11 @@
|
|
|
445
444
|
},
|
|
446
445
|
|
|
447
446
|
right: function () {
|
|
448
|
-
|
|
447
|
+
const height = {
|
|
449
448
|
active: $activeSide.outerWidth(true),
|
|
450
449
|
next: $nextSide.outerWidth(true),
|
|
451
450
|
};
|
|
452
|
-
|
|
451
|
+
const box = {
|
|
453
452
|
origin: (height.active - height.next) / 2,
|
|
454
453
|
depth: {
|
|
455
454
|
active: height.next / 2,
|
|
@@ -470,11 +469,11 @@
|
|
|
470
469
|
},
|
|
471
470
|
|
|
472
471
|
behind: function () {
|
|
473
|
-
|
|
472
|
+
const height = {
|
|
474
473
|
active: $activeSide.outerWidth(true),
|
|
475
474
|
next: $nextSide.outerWidth(true),
|
|
476
475
|
};
|
|
477
|
-
|
|
476
|
+
const box = {
|
|
478
477
|
origin: (height.active - height.next) / 2,
|
|
479
478
|
depth: {
|
|
480
479
|
active: height.next / 2,
|
|
@@ -594,7 +593,7 @@
|
|
|
594
593
|
query = query.split(/[ .]/);
|
|
595
594
|
maxDepth = query.length - 1;
|
|
596
595
|
$.each(query, function (depth, value) {
|
|
597
|
-
|
|
596
|
+
const camelCaseValue = depth !== maxDepth
|
|
598
597
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
599
598
|
: query;
|
|
600
599
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
|
@@ -637,7 +636,7 @@
|
|
|
637
636
|
if (instance === undefined) {
|
|
638
637
|
module.initialize();
|
|
639
638
|
}
|
|
640
|
-
|
|
639
|
+
const $inputs = $module.find('input');
|
|
641
640
|
if ($inputs.length > 0) {
|
|
642
641
|
$inputs.trigger('blur');
|
|
643
642
|
setTimeout(function () {
|
|
@@ -20,20 +20,20 @@
|
|
|
20
20
|
: globalThis;
|
|
21
21
|
|
|
22
22
|
$.fn.sidebar = function (...args) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
29
|
|
|
30
30
|
let time = Date.now();
|
|
31
31
|
let performance = [];
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const parameters = args[0];
|
|
34
|
+
const methodInvoked = typeof parameters === 'string';
|
|
35
|
+
const queryArguments = args.slice(1);
|
|
36
|
+
const contextCheck = function (context, win) {
|
|
37
37
|
let $context;
|
|
38
38
|
if ([window, document].includes(context)) {
|
|
39
39
|
$context = $body;
|
|
@@ -49,29 +49,29 @@
|
|
|
49
49
|
let returnedValue;
|
|
50
50
|
|
|
51
51
|
$allModules.each(function () {
|
|
52
|
-
|
|
52
|
+
const settings = $.isPlainObject(parameters)
|
|
53
53
|
? $.extend(true, {}, $.fn.sidebar.settings, parameters)
|
|
54
54
|
: $.extend({}, $.fn.sidebar.settings);
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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;
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
const eventNamespace = '.' + namespace;
|
|
63
|
+
const moduleNamespace = 'module-' + namespace;
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
const $module = $(this);
|
|
66
66
|
let $context = contextCheck(settings.context, window);
|
|
67
|
-
|
|
67
|
+
const isBody = $context[0] === $body[0];
|
|
68
68
|
|
|
69
69
|
let $sidebars = $module.children(selector.sidebar);
|
|
70
70
|
let $fixed = $context.children(selector.fixed);
|
|
71
71
|
let $pusher = $context.children(selector.pusher);
|
|
72
72
|
let $style;
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
const element = this;
|
|
75
75
|
let instance = $module.data(moduleNamespace);
|
|
76
76
|
|
|
77
77
|
let elementNamespace;
|
|
@@ -82,9 +82,7 @@
|
|
|
82
82
|
let tempBodyMargin = 0;
|
|
83
83
|
let hadScrollbar = false;
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
module = {
|
|
85
|
+
const module = {
|
|
88
86
|
|
|
89
87
|
initialize: function () {
|
|
90
88
|
module.debug('Initializing sidebar', parameters);
|
|
@@ -134,8 +132,8 @@
|
|
|
134
132
|
event: {
|
|
135
133
|
clickaway: function (event) {
|
|
136
134
|
if (settings.closable) {
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
const clickedInPusher = $pusher.find(event.target).length > 0 || $pusher.is(event.target);
|
|
136
|
+
const clickedContext = $context.is(event.target);
|
|
139
137
|
if (clickedInPusher) {
|
|
140
138
|
module.verbose('User clicked on dimmed page');
|
|
141
139
|
module.hide();
|
|
@@ -206,11 +204,11 @@
|
|
|
206
204
|
|
|
207
205
|
add: {
|
|
208
206
|
inlineCSS: function () {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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 = {
|
|
214
212
|
left: width,
|
|
215
213
|
right: -width,
|
|
216
214
|
top: height,
|
|
@@ -265,7 +263,7 @@
|
|
|
265
263
|
repaint: function () {
|
|
266
264
|
module.verbose('Forcing repaint event');
|
|
267
265
|
element.style.display = 'none';
|
|
268
|
-
|
|
266
|
+
const ignored = element.offsetHeight;
|
|
269
267
|
element.scrollTop = element.scrollTop; // eslint-disable-line no-self-assign
|
|
270
268
|
element.style.display = '';
|
|
271
269
|
},
|
|
@@ -302,7 +300,7 @@
|
|
|
302
300
|
},
|
|
303
301
|
|
|
304
302
|
attachEvents: function (selector, event) {
|
|
305
|
-
|
|
303
|
+
const $toggle = $(selector);
|
|
306
304
|
event = isFunction(module[event])
|
|
307
305
|
? module[event]
|
|
308
306
|
: module.toggle;
|
|
@@ -327,7 +325,7 @@
|
|
|
327
325
|
bodyMargin: function () {
|
|
328
326
|
initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
|
|
329
327
|
initialBodyMarginInt = parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10);
|
|
330
|
-
|
|
328
|
+
const bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
|
|
331
329
|
tempBodyMargin = initialBodyMarginInt + bodyScrollbarWidth;
|
|
332
330
|
},
|
|
333
331
|
},
|
|
@@ -398,13 +396,13 @@
|
|
|
398
396
|
},
|
|
399
397
|
|
|
400
398
|
hideOthers: function (callback = function () {}) {
|
|
401
|
-
|
|
402
|
-
|
|
399
|
+
const $otherSidebars = $sidebars.not($module).filter('.' + className.visible);
|
|
400
|
+
const sidebarCount = $otherSidebars.length;
|
|
403
401
|
let callbackCount = 0;
|
|
404
402
|
$otherSidebars
|
|
405
403
|
.sidebar('hide', function () {
|
|
406
404
|
callbackCount++;
|
|
407
|
-
if (callbackCount === sidebarCount) {
|
|
405
|
+
if (callbackCount === sidebarCount && isFunction(callback)) {
|
|
408
406
|
callback();
|
|
409
407
|
}
|
|
410
408
|
});
|
|
@@ -420,13 +418,10 @@
|
|
|
420
418
|
},
|
|
421
419
|
|
|
422
420
|
pushPage: function (callback) {
|
|
423
|
-
|
|
424
|
-
|
|
421
|
+
const transition = module.get.transition();
|
|
422
|
+
const $transition = transition === 'overlay' || module.othersActive()
|
|
425
423
|
? $module
|
|
426
424
|
: $pusher;
|
|
427
|
-
let animate;
|
|
428
|
-
let dim;
|
|
429
|
-
let transitionEnd;
|
|
430
425
|
callback = isFunction(callback)
|
|
431
426
|
? callback
|
|
432
427
|
: function () {};
|
|
@@ -439,16 +434,16 @@
|
|
|
439
434
|
module.bind.scrollLock();
|
|
440
435
|
module.set.transition(transition);
|
|
441
436
|
module.repaint();
|
|
442
|
-
animate = function () {
|
|
437
|
+
const animate = function () {
|
|
443
438
|
module.bind.clickaway();
|
|
444
439
|
module.add.inlineCSS();
|
|
445
440
|
module.set.animating();
|
|
446
441
|
module.set.visible();
|
|
447
442
|
};
|
|
448
|
-
dim = function () {
|
|
443
|
+
const dim = function () {
|
|
449
444
|
module.set.dimmed();
|
|
450
445
|
};
|
|
451
|
-
transitionEnd = function (event) {
|
|
446
|
+
const transitionEnd = function (event) {
|
|
452
447
|
if (event.target === $transition[0]) {
|
|
453
448
|
$transition.off('transitionend' + elementNamespace, transitionEnd);
|
|
454
449
|
module.remove.animating();
|
|
@@ -464,12 +459,10 @@
|
|
|
464
459
|
},
|
|
465
460
|
|
|
466
461
|
pullPage: function (callback) {
|
|
467
|
-
|
|
468
|
-
|
|
462
|
+
const transition = module.get.transition();
|
|
463
|
+
const $transition = transition === 'overlay' || module.othersActive()
|
|
469
464
|
? $module
|
|
470
465
|
: $pusher;
|
|
471
|
-
let animate;
|
|
472
|
-
let transitionEnd;
|
|
473
466
|
callback = isFunction(callback)
|
|
474
467
|
? callback
|
|
475
468
|
: function () {};
|
|
@@ -478,7 +471,7 @@
|
|
|
478
471
|
module.unbind.clickaway();
|
|
479
472
|
module.unbind.scrollLock();
|
|
480
473
|
|
|
481
|
-
animate = function () {
|
|
474
|
+
const animate = function () {
|
|
482
475
|
module.set.transition(transition);
|
|
483
476
|
module.set.animating();
|
|
484
477
|
if (settings.dimPage && !module.othersVisible()) {
|
|
@@ -486,7 +479,7 @@
|
|
|
486
479
|
}
|
|
487
480
|
module.remove.visible();
|
|
488
481
|
};
|
|
489
|
-
transitionEnd = function (event) {
|
|
482
|
+
const transitionEnd = function (event) {
|
|
490
483
|
if (event.target === $transition[0]) {
|
|
491
484
|
$transition.off('transitionend' + elementNamespace, transitionEnd);
|
|
492
485
|
module.remove.animating();
|
|
@@ -527,11 +520,11 @@
|
|
|
527
520
|
|
|
528
521
|
set: {
|
|
529
522
|
bodyMargin: function () {
|
|
530
|
-
|
|
523
|
+
const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
|
531
524
|
$context.css((isBody ? 'margin-' : 'padding-') + position, tempBodyMargin + 'px');
|
|
532
525
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
|
533
|
-
|
|
534
|
-
|
|
526
|
+
const el = $(this);
|
|
527
|
+
const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
|
535
528
|
el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
|
|
536
529
|
});
|
|
537
530
|
},
|
|
@@ -621,11 +614,11 @@
|
|
|
621
614
|
},
|
|
622
615
|
restore: {
|
|
623
616
|
bodyMargin: function () {
|
|
624
|
-
|
|
617
|
+
const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
|
625
618
|
$context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMarginInt === 0 ? '' : initialBodyMargin);
|
|
626
619
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
|
627
|
-
|
|
628
|
-
|
|
620
|
+
const el = $(this);
|
|
621
|
+
const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
|
629
622
|
el.css(attribute, '');
|
|
630
623
|
});
|
|
631
624
|
},
|
|
@@ -645,9 +638,8 @@
|
|
|
645
638
|
return className.left;
|
|
646
639
|
},
|
|
647
640
|
transition: function () {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
transition = module.is.mobile()
|
|
641
|
+
const direction = module.get.direction();
|
|
642
|
+
const transition = module.is.mobile()
|
|
651
643
|
? (settings.mobileTransition === 'auto'
|
|
652
644
|
? settings.defaultTransition.mobile[direction]
|
|
653
645
|
: settings.mobileTransition)
|
|
@@ -683,8 +675,8 @@
|
|
|
683
675
|
return !(self === top);
|
|
684
676
|
},
|
|
685
677
|
mobile: function () {
|
|
686
|
-
|
|
687
|
-
|
|
678
|
+
const userAgent = navigator.userAgent;
|
|
679
|
+
const isMobile = userAgent.match(regExp.mobile);
|
|
688
680
|
if (isMobile) {
|
|
689
681
|
module.verbose('Browser was found to be mobile', userAgent);
|
|
690
682
|
|
|
@@ -820,7 +812,7 @@
|
|
|
820
812
|
query = query.split(/[ .]/);
|
|
821
813
|
maxDepth = query.length - 1;
|
|
822
814
|
$.each(query, function (depth, value) {
|
|
823
|
-
|
|
815
|
+
const camelCaseValue = depth !== maxDepth
|
|
824
816
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
825
817
|
: query;
|
|
826
818
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|