fomantic-ui 2.9.0-beta.310 → 2.9.0-beta.311

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.
Files changed (151) hide show
  1. package/dist/components/accordion.css +1 -1
  2. package/dist/components/accordion.js +1 -1
  3. package/dist/components/accordion.min.css +1 -1
  4. package/dist/components/accordion.min.js +1 -1
  5. package/dist/components/ad.css +1 -1
  6. package/dist/components/ad.min.css +1 -1
  7. package/dist/components/api.js +1 -1
  8. package/dist/components/api.min.js +1 -1
  9. package/dist/components/breadcrumb.css +1 -1
  10. package/dist/components/breadcrumb.min.css +1 -1
  11. package/dist/components/button.css +1 -1
  12. package/dist/components/button.min.css +1 -1
  13. package/dist/components/calendar.css +1 -1
  14. package/dist/components/calendar.js +1 -1
  15. package/dist/components/calendar.min.css +1 -1
  16. package/dist/components/calendar.min.js +1 -1
  17. package/dist/components/card.css +1 -1
  18. package/dist/components/card.min.css +1 -1
  19. package/dist/components/checkbox.css +1 -1
  20. package/dist/components/checkbox.js +1 -1
  21. package/dist/components/checkbox.min.css +1 -1
  22. package/dist/components/checkbox.min.js +1 -1
  23. package/dist/components/comment.css +1 -1
  24. package/dist/components/comment.min.css +1 -1
  25. package/dist/components/container.css +1 -1
  26. package/dist/components/container.min.css +1 -1
  27. package/dist/components/dimmer.css +1 -1
  28. package/dist/components/dimmer.js +1 -1
  29. package/dist/components/dimmer.min.css +1 -1
  30. package/dist/components/dimmer.min.js +1 -1
  31. package/dist/components/divider.css +1 -1
  32. package/dist/components/divider.min.css +1 -1
  33. package/dist/components/dropdown.css +1 -1
  34. package/dist/components/dropdown.js +1 -1
  35. package/dist/components/dropdown.min.css +1 -1
  36. package/dist/components/dropdown.min.js +1 -1
  37. package/dist/components/embed.css +1 -1
  38. package/dist/components/embed.js +1 -1
  39. package/dist/components/embed.min.css +1 -1
  40. package/dist/components/embed.min.js +1 -1
  41. package/dist/components/feed.css +1 -1
  42. package/dist/components/feed.min.css +1 -1
  43. package/dist/components/flag.css +1 -1
  44. package/dist/components/flag.min.css +1 -1
  45. package/dist/components/form.css +1 -1
  46. package/dist/components/form.js +1 -1
  47. package/dist/components/form.min.css +1 -1
  48. package/dist/components/form.min.js +1 -1
  49. package/dist/components/grid.css +1 -1
  50. package/dist/components/grid.min.css +1 -1
  51. package/dist/components/header.css +1 -1
  52. package/dist/components/header.min.css +1 -1
  53. package/dist/components/icon.css +1 -1
  54. package/dist/components/icon.min.css +1 -1
  55. package/dist/components/image.css +1 -1
  56. package/dist/components/image.min.css +1 -1
  57. package/dist/components/input.css +1 -1
  58. package/dist/components/input.min.css +1 -1
  59. package/dist/components/item.css +1 -1
  60. package/dist/components/item.min.css +1 -1
  61. package/dist/components/label.css +1 -1
  62. package/dist/components/label.min.css +1 -1
  63. package/dist/components/list.css +1 -1
  64. package/dist/components/list.min.css +1 -1
  65. package/dist/components/loader.css +1 -1
  66. package/dist/components/loader.min.css +1 -1
  67. package/dist/components/message.css +1 -1
  68. package/dist/components/message.min.css +1 -1
  69. package/dist/components/modal.css +1 -1
  70. package/dist/components/modal.js +1 -1
  71. package/dist/components/modal.min.css +1 -1
  72. package/dist/components/modal.min.js +1 -1
  73. package/dist/components/nag.css +1 -1
  74. package/dist/components/nag.js +1 -1
  75. package/dist/components/nag.min.css +1 -1
  76. package/dist/components/nag.min.js +1 -1
  77. package/dist/components/placeholder.css +1 -1
  78. package/dist/components/placeholder.min.css +1 -1
  79. package/dist/components/popup.css +1 -1
  80. package/dist/components/popup.js +1 -1
  81. package/dist/components/popup.min.css +1 -1
  82. package/dist/components/popup.min.js +1 -1
  83. package/dist/components/progress.css +1 -1
  84. package/dist/components/progress.js +1 -1
  85. package/dist/components/progress.min.css +1 -1
  86. package/dist/components/progress.min.js +1 -1
  87. package/dist/components/rail.css +1 -1
  88. package/dist/components/rail.min.css +1 -1
  89. package/dist/components/rating.css +1 -1
  90. package/dist/components/rating.js +1 -1
  91. package/dist/components/rating.min.css +1 -1
  92. package/dist/components/rating.min.js +1 -1
  93. package/dist/components/reset.css +1 -1
  94. package/dist/components/reset.min.css +1 -1
  95. package/dist/components/reveal.css +1 -1
  96. package/dist/components/reveal.min.css +1 -1
  97. package/dist/components/search.css +1 -1
  98. package/dist/components/search.js +1 -1
  99. package/dist/components/search.min.css +1 -1
  100. package/dist/components/search.min.js +1 -1
  101. package/dist/components/segment.css +1 -1
  102. package/dist/components/segment.min.css +1 -1
  103. package/dist/components/shape.css +1 -1
  104. package/dist/components/shape.js +1 -1
  105. package/dist/components/shape.min.css +1 -1
  106. package/dist/components/shape.min.js +1 -1
  107. package/dist/components/sidebar.css +7 -3
  108. package/dist/components/sidebar.js +104 -27
  109. package/dist/components/sidebar.min.css +2 -2
  110. package/dist/components/sidebar.min.js +2 -2
  111. package/dist/components/site.css +1 -1
  112. package/dist/components/site.js +1 -1
  113. package/dist/components/site.min.css +1 -1
  114. package/dist/components/site.min.js +1 -1
  115. package/dist/components/slider.js +1 -1
  116. package/dist/components/slider.min.js +1 -1
  117. package/dist/components/state.js +1 -1
  118. package/dist/components/state.min.js +1 -1
  119. package/dist/components/statistic.css +1 -1
  120. package/dist/components/statistic.min.css +1 -1
  121. package/dist/components/step.css +1 -1
  122. package/dist/components/step.min.css +1 -1
  123. package/dist/components/sticky.css +1 -1
  124. package/dist/components/sticky.js +1 -1
  125. package/dist/components/sticky.min.css +1 -1
  126. package/dist/components/sticky.min.js +1 -1
  127. package/dist/components/tab.css +1 -1
  128. package/dist/components/tab.js +1 -1
  129. package/dist/components/tab.min.css +1 -1
  130. package/dist/components/tab.min.js +1 -1
  131. package/dist/components/table.css +1 -1
  132. package/dist/components/table.min.css +1 -1
  133. package/dist/components/text.css +1 -1
  134. package/dist/components/text.min.css +1 -1
  135. package/dist/components/toast.css +1 -1
  136. package/dist/components/toast.js +1 -1
  137. package/dist/components/toast.min.css +1 -1
  138. package/dist/components/toast.min.js +1 -1
  139. package/dist/components/transition.css +1 -1
  140. package/dist/components/transition.js +1 -1
  141. package/dist/components/transition.min.css +1 -1
  142. package/dist/components/transition.min.js +1 -1
  143. package/dist/components/visibility.js +1 -1
  144. package/dist/components/visibility.min.js +1 -1
  145. package/dist/semantic.css +56 -51
  146. package/dist/semantic.js +128 -51
  147. package/dist/semantic.min.css +2 -2
  148. package/dist/semantic.min.js +2 -2
  149. package/package.json +1 -1
  150. package/src/definitions/modules/sidebar.js +103 -26
  151. package/src/definitions/modules/sidebar.less +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fomantic-ui",
3
- "version": "2.9.0-beta.310+19b7d18",
3
+ "version": "2.9.0-beta.311+116f84b",
4
4
  "description": "Fomantic empowers designers and developers by creating a shared vocabulary for UI.",
5
5
  "keywords": [
6
6
  "fomantic-ui",
@@ -28,6 +28,7 @@ $.fn.sidebar = function(parameters) {
28
28
  $allModules = $(this),
29
29
  $window = $(window),
30
30
  $document = $(document),
31
+ $body = $('body'),
31
32
  $html = $('html'),
32
33
  $head = $('head'),
33
34
 
@@ -66,7 +67,8 @@ $.fn.sidebar = function(parameters) {
66
67
  moduleNamespace = 'module-' + namespace,
67
68
 
68
69
  $module = $(this),
69
- $context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context),
70
+ $context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $body,
71
+ isBody = $context[0] === $body[0],
70
72
 
71
73
  $sidebars = $module.children(selector.sidebar),
72
74
  $fixed = $context.children(selector.fixed),
@@ -80,6 +82,9 @@ $.fn.sidebar = function(parameters) {
80
82
  id,
81
83
  currentScroll,
82
84
  transitionEvent,
85
+ initialBodyMargin = '',
86
+ tempBodyMargin = '',
87
+ hadScrollbar = false,
83
88
 
84
89
  module
85
90
  ;
@@ -185,9 +190,12 @@ $.fn.sidebar = function(parameters) {
185
190
  scrollLock: function() {
186
191
  if(settings.scrollLock) {
187
192
  module.debug('Disabling page scroll');
188
- $window
189
- .on('DOMMouseScroll' + elementNamespace, module.event.scroll)
190
- ;
193
+ hadScrollbar = module.has.scrollbar();
194
+ if(hadScrollbar) {
195
+ module.save.bodyMargin();
196
+ module.set.bodyMargin();
197
+ }
198
+ $context.addClass(className.locked);
191
199
  }
192
200
  module.verbose('Adding events to contain sidebar scroll');
193
201
  $document
@@ -205,8 +213,11 @@ $.fn.sidebar = function(parameters) {
205
213
  },
206
214
  scrollLock: function() {
207
215
  module.verbose('Removing scroll lock from page');
216
+ if(hadScrollbar) {
217
+ module.restore.bodyMargin();
218
+ }
219
+ $context.removeClass(className.locked);
208
220
  $document.off(elementNamespace);
209
- $window.off(elementNamespace);
210
221
  $module.off('scroll' + eventNamespace);
211
222
  }
212
223
  },
@@ -364,7 +375,22 @@ $.fn.sidebar = function(parameters) {
364
375
  module.error(error.notFound, selector);
365
376
  }
366
377
  },
367
-
378
+ can: {
379
+ leftBodyScrollbar: function () {
380
+ if (module.cache.leftBodyScrollbar === undefined) {
381
+ module.cache.leftBodyScrollbar = module.is.rtl() && ((module.is.iframe && !module.is.firefox()) || module.is.safari() || module.is.edge() || module.is.ie());
382
+ }
383
+ return module.cache.leftBodyScrollbar;
384
+ }
385
+ },
386
+ save: {
387
+ bodyMargin: function() {
388
+ initialBodyMargin = $context.css((isBody ? 'margin-':'padding-')+(module.can.leftBodyScrollbar() ? 'left':'right'));
389
+ var bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, '')),
390
+ bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
391
+ tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
392
+ }
393
+ },
368
394
  show: function(callback) {
369
395
  callback = $.isFunction(callback)
370
396
  ? callback
@@ -475,9 +501,13 @@ $.fn.sidebar = function(parameters) {
475
501
  ? callback
476
502
  : function(){}
477
503
  ;
478
- if(settings.transition == 'scale down') {
504
+ if(settings.returnScroll) {
505
+ currentScroll = (isBody ? $window : $context).scrollTop();
506
+ }
507
+ if(settings.transition === 'scale down') {
479
508
  module.scrollToTop();
480
509
  }
510
+ module.bind.scrollLock();
481
511
  module.set.transition(transition);
482
512
  module.repaint();
483
513
  animate = function() {
@@ -493,7 +523,6 @@ $.fn.sidebar = function(parameters) {
493
523
  if( event.target == $transition[0] ) {
494
524
  $transition.off(transitionEvent + elementNamespace, transitionEnd);
495
525
  module.remove.animating();
496
- module.bind.scrollLock();
497
526
  callback.call(element);
498
527
  }
499
528
  };
@@ -537,7 +566,7 @@ $.fn.sidebar = function(parameters) {
537
566
  module.remove.animating();
538
567
  module.remove.transition();
539
568
  module.remove.inlineCSS();
540
- if(transition == 'scale down' || (settings.returnScroll && module.is.mobile()) ) {
569
+ if(transition === 'scale down' || settings.returnScroll) {
541
570
  module.scrollBack();
542
571
  }
543
572
  callback.call(element);
@@ -550,14 +579,13 @@ $.fn.sidebar = function(parameters) {
550
579
 
551
580
  scrollToTop: function() {
552
581
  module.verbose('Scrolling to top of page to avoid animation issues');
553
- currentScroll = $(window).scrollTop();
554
582
  $module.scrollTop(0);
555
- window.scrollTo(0, 0);
583
+ (isBody ? $window : $context)[0].scrollTo(0, 0);
556
584
  },
557
585
 
558
586
  scrollBack: function() {
559
587
  module.verbose('Scrolling back to original page position');
560
- window.scrollTo(0, currentScroll);
588
+ (isBody ? $window : $context)[0].scrollTo(0, currentScroll);
561
589
  },
562
590
 
563
591
  clear: {
@@ -568,7 +596,16 @@ $.fn.sidebar = function(parameters) {
568
596
  },
569
597
 
570
598
  set: {
571
-
599
+ bodyMargin: function() {
600
+ var position = module.can.leftBodyScrollbar() ? 'left':'right';
601
+ $context.css((isBody ? 'margin-':'padding-')+position, tempBodyMargin + 'px');
602
+ $context.find(selector.bodyFixed.replace('right',position)).each(function(){
603
+ var el = $(this),
604
+ attribute = el.css('position') === 'fixed' ? 'padding-'+position : position
605
+ ;
606
+ el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
607
+ });
608
+ },
572
609
  // ios only (scroll on html not document). This prevent auto-resize canvas/scroll in ios
573
610
  // (This is no longer necessary in latest iOS)
574
611
  ios: function() {
@@ -654,7 +691,18 @@ $.fn.sidebar = function(parameters) {
654
691
  $module.removeClass(className.overlay);
655
692
  }
656
693
  },
657
-
694
+ restore: {
695
+ bodyMargin: function() {
696
+ var position = module.can.leftBodyScrollbar() ? 'left':'right';
697
+ $context.css((isBody ? 'margin-':'padding-')+position, initialBodyMargin);
698
+ $context.find(selector.bodyFixed.replace('right',position)).each(function(){
699
+ var el = $(this),
700
+ attribute = el.css('position') === 'fixed' ? 'padding-'+position : position
701
+ ;
702
+ el.css(attribute, '');
703
+ });
704
+ }
705
+ },
658
706
  get: {
659
707
  direction: function() {
660
708
  if($module.hasClass(className.top)) {
@@ -702,15 +750,42 @@ $.fn.sidebar = function(parameters) {
702
750
  }
703
751
  }
704
752
  },
705
-
753
+ has: {
754
+ scrollbar: function() {
755
+ return isBody || $context.css('overflow-y') !== 'hidden';
756
+ }
757
+ },
706
758
  is: {
707
-
759
+ safari: function() {
760
+ if(module.cache.isSafari === undefined) {
761
+ module.cache.isSafari = /constructor/i.test(window.HTMLElement) || !!window.ApplePaySession;
762
+ }
763
+ return module.cache.isSafari;
764
+ },
765
+ edge: function(){
766
+ if(module.cache.isEdge === undefined) {
767
+ module.cache.isEdge = !!window.setImmediate && !module.is.ie();
768
+ }
769
+ return module.cache.isEdge;
770
+ },
771
+ firefox: function(){
772
+ if(module.cache.isFirefox === undefined) {
773
+ module.cache.isFirefox = !!window.InstallTrigger;
774
+ }
775
+ return module.cache.isFirefox;
776
+ },
777
+ iframe: function() {
778
+ return !(self === top);
779
+ },
708
780
  ie: function() {
709
- var
710
- isIE11 = (!(window.ActiveXObject) && 'ActiveXObject' in window),
711
- isIE = ('ActiveXObject' in window)
712
- ;
713
- return (isIE11 || isIE);
781
+ if(module.cache.isIE === undefined) {
782
+ var
783
+ isIE11 = (!(window.ActiveXObject) && 'ActiveXObject' in window),
784
+ isIE = ('ActiveXObject' in window)
785
+ ;
786
+ module.cache.isIE = (isIE11 || isIE);
787
+ }
788
+ return module.cache.isIE;
714
789
  },
715
790
 
716
791
  ios: function() {
@@ -760,12 +835,12 @@ $.fn.sidebar = function(parameters) {
760
835
  animating: function() {
761
836
  return $context.hasClass(className.animating);
762
837
  },
763
- rtl: function () {
764
- if(module.cache.rtl === undefined) {
765
- module.cache.rtl = $module.attr('dir') === 'rtl' || $module.css('direction') === 'rtl';
838
+ rtl: function() {
839
+ if(module.cache.isRTL === undefined) {
840
+ module.cache.isRTL = $module.attr('dir') === 'rtl' || $module.css('direction') === 'rtl' || $body.attr('dir') === 'rtl' || $body.css('direction') === 'rtl' || $context.attr('dir') === 'rtl' || $context.css('direction') === 'rtl';
766
841
  }
767
- return module.cache.rtl;
768
- }
842
+ return module.cache.isRTL;
843
+ },
769
844
  },
770
845
 
771
846
  setting: function(name, value) {
@@ -1002,6 +1077,7 @@ $.fn.sidebar.settings = {
1002
1077
  animating : 'animating',
1003
1078
  dimmed : 'dimmed',
1004
1079
  ios : 'ios',
1080
+ locked : 'locked',
1005
1081
  pushable : 'pushable',
1006
1082
  pushed : 'pushed',
1007
1083
  right : 'right',
@@ -1012,6 +1088,7 @@ $.fn.sidebar.settings = {
1012
1088
  },
1013
1089
 
1014
1090
  selector: {
1091
+ bodyFixed: '> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close',
1015
1092
  fixed : '.fixed',
1016
1093
  omitted : 'script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed',
1017
1094
  pusher : '.pusher',
@@ -95,10 +95,14 @@
95
95
  Pushable
96
96
  ---------------*/
97
97
 
98
- .pushable {
98
+ .pushable.pushable.pushable {
99
99
  height: 100%;
100
100
  overflow-x: hidden;
101
- padding: 0 !important;
101
+ padding: 0;
102
+ &.locked {
103
+ overflow-y: hidden;
104
+ background: inherit;
105
+ }
102
106
  }
103
107
 
104
108
  /* Whole Page */