fomantic-ui-sass 2.9.1 → 2.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/app/assets/fonts/semantic-ui/Lato-Bold.woff +0 -0
  4. data/app/assets/fonts/semantic-ui/Lato-Bold.woff2 +0 -0
  5. data/app/assets/fonts/semantic-ui/Lato-BoldItalic.woff +0 -0
  6. data/app/assets/fonts/semantic-ui/Lato-BoldItalic.woff2 +0 -0
  7. data/app/assets/fonts/semantic-ui/Lato-Italic.woff +0 -0
  8. data/app/assets/fonts/semantic-ui/Lato-Italic.woff2 +0 -0
  9. data/app/assets/fonts/semantic-ui/Lato-Regular.woff +0 -0
  10. data/app/assets/fonts/semantic-ui/Lato-Regular.woff2 +0 -0
  11. data/app/assets/fonts/semantic-ui/LatoLatin-Bold.woff +0 -0
  12. data/app/assets/fonts/semantic-ui/LatoLatin-Bold.woff2 +0 -0
  13. data/app/assets/fonts/semantic-ui/LatoLatin-BoldItalic.woff +0 -0
  14. data/app/assets/fonts/semantic-ui/LatoLatin-BoldItalic.woff2 +0 -0
  15. data/app/assets/fonts/semantic-ui/LatoLatin-Italic.woff +0 -0
  16. data/app/assets/fonts/semantic-ui/LatoLatin-Italic.woff2 +0 -0
  17. data/app/assets/fonts/semantic-ui/LatoLatin-Regular.woff +0 -0
  18. data/app/assets/fonts/semantic-ui/LatoLatin-Regular.woff2 +0 -0
  19. data/app/assets/javascripts/semantic-ui/accordion.js +4 -8
  20. data/app/assets/javascripts/semantic-ui/api.js +22 -15
  21. data/app/assets/javascripts/semantic-ui/calendar.js +1 -6
  22. data/app/assets/javascripts/semantic-ui/checkbox.js +4 -6
  23. data/app/assets/javascripts/semantic-ui/dimmer.js +3 -7
  24. data/app/assets/javascripts/semantic-ui/dropdown.js +58 -35
  25. data/app/assets/javascripts/semantic-ui/embed.js +2 -7
  26. data/app/assets/javascripts/semantic-ui/flyout.js +56 -86
  27. data/app/assets/javascripts/semantic-ui/form.js +216 -157
  28. data/app/assets/javascripts/semantic-ui/modal.js +58 -39
  29. data/app/assets/javascripts/semantic-ui/nag.js +17 -9
  30. data/app/assets/javascripts/semantic-ui/popup.js +46 -26
  31. data/app/assets/javascripts/semantic-ui/progress.js +3 -34
  32. data/app/assets/javascripts/semantic-ui/rating.js +1 -5
  33. data/app/assets/javascripts/semantic-ui/search.js +5 -8
  34. data/app/assets/javascripts/semantic-ui/shape.js +15 -41
  35. data/app/assets/javascripts/semantic-ui/sidebar.js +21 -64
  36. data/app/assets/javascripts/semantic-ui/site.js +1 -1
  37. data/app/assets/javascripts/semantic-ui/slider.js +130 -34
  38. data/app/assets/javascripts/semantic-ui/state.js +23 -20
  39. data/app/assets/javascripts/semantic-ui/sticky.js +17 -16
  40. data/app/assets/javascripts/semantic-ui/tab.js +18 -8
  41. data/app/assets/javascripts/semantic-ui/toast.js +19 -11
  42. data/app/assets/javascripts/semantic-ui/transition.js +11 -66
  43. data/app/assets/javascripts/semantic-ui/visibility.js +15 -6
  44. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +1 -1
  45. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +118 -56
  46. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +113 -107
  47. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +39 -9
  48. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +1 -1
  49. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +66 -2
  50. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +2 -2
  51. data/app/assets/stylesheets/semantic-ui/elements/_container.scss +62 -1
  52. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +1 -1
  53. data/app/assets/stylesheets/semantic-ui/elements/_emoji.scss +698 -250
  54. data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +3 -2
  55. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +1 -1
  56. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +62 -62
  57. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +1 -1
  58. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +61 -51
  59. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +21 -2
  60. data/app/assets/stylesheets/semantic-ui/elements/_list.scss +13 -13
  61. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +282 -282
  62. data/app/assets/stylesheets/semantic-ui/elements/_placeholder.scss +1 -1
  63. data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +1 -1
  64. data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +1 -1
  65. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +186 -37
  66. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +4 -4
  67. data/app/assets/stylesheets/semantic-ui/elements/_text.scss +2 -2
  68. data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +1 -1
  69. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +1 -10
  70. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +1 -1
  71. data/app/assets/stylesheets/semantic-ui/modules/_calendar.scss +145 -8
  72. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +89 -45
  73. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +3 -3
  74. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +126 -31
  75. data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +2 -2
  76. data/app/assets/stylesheets/semantic-ui/modules/_flyout.scss +1 -1
  77. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +10 -3
  78. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +1 -1
  79. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +188 -42
  80. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +1 -1
  81. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +1 -1
  82. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +26 -1
  83. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +1 -1
  84. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +1 -1
  85. data/app/assets/stylesheets/semantic-ui/modules/_slider.scss +9 -6
  86. data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +1 -1
  87. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +1 -1
  88. data/app/assets/stylesheets/semantic-ui/modules/_toast.scss +6 -1
  89. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +1 -1
  90. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +1 -1
  91. data/app/assets/stylesheets/semantic-ui/views/_card.scss +1 -1
  92. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +6 -1
  93. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +486 -5
  94. data/app/assets/stylesheets/semantic-ui/views/_item.scss +7 -2
  95. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +1 -1
  96. data/lib/fomantic/ui/sass/version.rb +2 -2
  97. metadata +1 -1
@@ -28,15 +28,25 @@
28
28
  $head = $('head'),
29
29
  $body = $('body'),
30
30
 
31
- moduleSelector = $allModules.selector || '',
32
-
33
31
  time = Date.now(),
34
32
  performance = [],
35
33
 
36
34
  query = arguments[0],
37
35
  methodInvoked = typeof query === 'string',
38
36
  queryArguments = [].slice.call(arguments, 1),
37
+ contextCheck = function (context, win) {
38
+ var $context;
39
+ if ([window, document].indexOf(context) >= 0) {
40
+ $context = $body;
41
+ } else {
42
+ $context = $(win.document).find(context);
43
+ if ($context.length === 0) {
44
+ $context = win.frameElement ? contextCheck(context, win.parent) : $body;
45
+ }
46
+ }
39
47
 
48
+ return $context;
49
+ },
40
50
  returnedValue
41
51
  ;
42
52
 
@@ -57,7 +67,7 @@
57
67
  moduleNamespace = 'module-' + namespace,
58
68
 
59
69
  $module = $(this),
60
- $context = [window, document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $body,
70
+ $context = contextCheck(settings.context, window),
61
71
  $closeIcon = $module.find(selector.close),
62
72
  $inputs,
63
73
  $focusedElement,
@@ -76,12 +86,13 @@
76
86
  initialBodyMargin = '',
77
87
  tempBodyMargin = '',
78
88
  hadScrollbar = false,
89
+ windowRefocused = false,
79
90
 
80
91
  elementNamespace,
81
92
  id,
82
93
  observer,
94
+ observeAttributes = false,
83
95
  currentScroll,
84
- transitionEvent,
85
96
 
86
97
  module
87
98
  ;
@@ -145,8 +156,6 @@
145
156
  });
146
157
  }
147
158
 
148
- transitionEvent = module.get.transitionEvent();
149
-
150
159
  // avoids locking rendering if initialized in onReady
151
160
  if (settings.delaySetup) {
152
161
  requestAnimationFrame(module.setup.layout);
@@ -224,9 +233,6 @@
224
233
  .off(eventNamespace)
225
234
  .removeData(moduleNamespace)
226
235
  ;
227
- if (module.is.ios()) {
228
- module.remove.ios();
229
- }
230
236
  $closeIcon.off(elementNamespace);
231
237
  if ($inputs) {
232
238
  $inputs.off(elementNamespace);
@@ -256,9 +262,13 @@
256
262
  module.setup.heights();
257
263
  },
258
264
  focus: function () {
259
- if (module.is.visible() && settings.autofocus && settings.dimPage) {
265
+ windowRefocused = true;
266
+ },
267
+ click: function (event) {
268
+ if (windowRefocused && document.activeElement !== event.target && module.is.visible() && settings.autofocus && settings.dimPage && $(document.activeElement).closest(selector.flyout).length === 0) {
260
269
  requestAnimationFrame(module.set.autofocus);
261
270
  }
271
+ windowRefocused = false;
262
272
  },
263
273
  clickaway: function (event) {
264
274
  if (settings.closable) {
@@ -365,6 +375,9 @@
365
375
  $window
366
376
  .on('focus' + elementNamespace, module.event.focus)
367
377
  ;
378
+ $context
379
+ .on('click' + elementNamespace, module.event.click)
380
+ ;
368
381
  },
369
382
  clickaway: function () {
370
383
  module.verbose('Adding clickaway events to context', $context);
@@ -494,11 +507,12 @@
494
507
 
495
508
  return nodes;
496
509
  },
497
- shouldRefreshInputs = false
510
+ shouldRefreshInputs = false,
511
+ ignoreAutofocus = true
498
512
  ;
499
513
  mutations.every(function (mutation) {
500
514
  if (mutation.type === 'attributes') {
501
- if (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input')) {
515
+ if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').filter(':visible').length > 0)) {
502
516
  shouldRefreshInputs = true;
503
517
  }
504
518
  } else {
@@ -508,6 +522,9 @@
508
522
  $removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
509
523
  if ($addedInputs.length > 0 || $removedInputs.length > 0) {
510
524
  shouldRefreshInputs = true;
525
+ if ($addedInputs.filter(':input').length > 0 || $removedInputs.filter(':input').length > 0) {
526
+ ignoreAutofocus = false;
527
+ }
511
528
  }
512
529
  }
513
530
 
@@ -515,7 +532,7 @@
515
532
  });
516
533
 
517
534
  if (shouldRefreshInputs) {
518
- module.refreshInputs();
535
+ module.refreshInputs(ignoreAutofocus);
519
536
  }
520
537
  });
521
538
  observer.observe(element, {
@@ -529,7 +546,7 @@
529
546
  },
530
547
  refresh: function () {
531
548
  module.verbose('Refreshing selector cache');
532
- $context = [window, document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $body;
549
+ $context = contextCheck(settings.context, window);
533
550
  module.refreshFlyouts();
534
551
  $pusher = $context.children(selector.pusher);
535
552
  module.clear.cache();
@@ -540,7 +557,7 @@
540
557
  $flyouts = $context.children(selector.flyout);
541
558
  },
542
559
 
543
- refreshInputs: function () {
560
+ refreshInputs: function (ignoreAutofocus) {
544
561
  if ($inputs) {
545
562
  $inputs
546
563
  .off('keydown' + elementNamespace)
@@ -549,13 +566,14 @@
549
566
  if (!settings.dimPage) {
550
567
  return;
551
568
  }
552
- $inputs = $module.find('[tabindex], :input:enabled').filter(':visible').filter(function () {
569
+ $inputs = $module.find('a[href], [tabindex], :input:enabled').filter(':visible').filter(function () {
553
570
  return $(this).closest('.disabled').length === 0;
554
571
  });
555
- $module.removeAttr('tabindex');
556
- if ($inputs.length === 0) {
557
- $inputs = $module;
572
+ if ($inputs.filter(':input').length === 0) {
573
+ $inputs = $module.add($inputs);
558
574
  $module.attr('tabindex', -1);
575
+ } else {
576
+ $module.removeAttr('tabindex');
559
577
  }
560
578
  $inputs.first()
561
579
  .on('keydown' + elementNamespace, module.event.inputKeyDown.first)
@@ -563,7 +581,7 @@
563
581
  $inputs.last()
564
582
  .on('keydown' + elementNamespace, module.event.inputKeyDown.last)
565
583
  ;
566
- if (settings.autofocus && $inputs.filter(':focus').length === 0) {
584
+ if (!ignoreAutofocus && settings.autofocus && $inputs.filter(':focus').length === 0) {
567
585
  module.set.autofocus();
568
586
  }
569
587
  },
@@ -652,6 +670,7 @@
652
670
  }
653
671
  }
654
672
  module.set.dimmerStyles();
673
+ module.set.observeAttributes(false);
655
674
  module.pushPage(function () {
656
675
  callback.call(element);
657
676
  settings.onVisible.call(element);
@@ -660,6 +679,7 @@
660
679
  }
661
680
  module.save.focus();
662
681
  module.refreshInputs();
682
+ requestAnimationFrame(module.set.observeAttributes);
663
683
  });
664
684
  settings.onChange.call(element);
665
685
  } else {
@@ -680,6 +700,7 @@
680
700
  if (module.is.visible() || module.is.animating()) {
681
701
  module.debug('Hiding flyout', callback);
682
702
  module.refreshFlyouts();
703
+ module.set.observeAttributes(false);
683
704
  module.pullPage(function () {
684
705
  callback.call(element);
685
706
  if (isFunction(settings.onHidden)) {
@@ -752,13 +773,13 @@
752
773
  };
753
774
  transitionEnd = function (event) {
754
775
  if (event.target === $module[0]) {
755
- $module.off(transitionEvent + elementNamespace, transitionEnd);
776
+ $module.off('transitionend' + elementNamespace, transitionEnd);
756
777
  module.remove.animating();
757
778
  callback.call(element);
758
779
  }
759
780
  };
760
- $module.off(transitionEvent + elementNamespace);
761
- $module.on(transitionEvent + elementNamespace, transitionEnd);
781
+ $module.off('transitionend' + elementNamespace);
782
+ $module.on('transitionend' + elementNamespace, transitionEnd);
762
783
  requestAnimationFrame(animate);
763
784
  if (settings.dimPage && !module.othersVisible()) {
764
785
  requestAnimationFrame(dim);
@@ -793,7 +814,7 @@
793
814
  };
794
815
  transitionEnd = function (event) {
795
816
  if (event.target === $module[0]) {
796
- $module.off(transitionEvent + elementNamespace, transitionEnd);
817
+ $module.off('transitionend' + elementNamespace, transitionEnd);
797
818
  module.remove.animating();
798
819
  module.remove.closing();
799
820
  module.remove.overlay();
@@ -807,8 +828,8 @@
807
828
  callback.call(element);
808
829
  }
809
830
  };
810
- $module.off(transitionEvent + elementNamespace);
811
- $module.on(transitionEvent + elementNamespace, transitionEnd);
831
+ $module.off('transitionend' + elementNamespace);
832
+ $module.on('transitionend' + elementNamespace, transitionEnd);
812
833
  requestAnimationFrame(animate);
813
834
  },
814
835
 
@@ -831,24 +852,21 @@
831
852
  },
832
853
 
833
854
  set: {
855
+ observeAttributes: function (state) {
856
+ observeAttributes = state !== false;
857
+ },
834
858
  autofocus: function () {
835
859
  var
836
860
  $autofocus = $inputs.filter('[autofocus]'),
837
861
  $rawInputs = $inputs.filter(':input'),
838
- $input = $autofocus.length > 0
839
- ? $autofocus.first()
862
+ $input = ($autofocus.length > 0
863
+ ? $autofocus
840
864
  : ($rawInputs.length > 0
841
865
  ? $rawInputs
842
- : $inputs.filter(':not(i.close)')
843
- ).first()
866
+ : $module)
867
+ ).first()
844
868
  ;
845
- // check if only the close icon is remaining
846
- if ($input.length === 0 && $inputs.length > 0) {
847
- $input = $inputs.first();
848
- }
849
- if ($input.length > 0) {
850
- $input.trigger('focus');
851
- }
869
+ $input.trigger('focus');
852
870
  },
853
871
  dimmerStyles: function () {
854
872
  if (settings.blurring) {
@@ -869,12 +887,6 @@
869
887
  });
870
888
  },
871
889
 
872
- // ios only (scroll on html not document). This prevent auto-resize canvas/scroll in ios
873
- // (This is no longer necessary in latest iOS)
874
- ios: function () {
875
- $html.addClass(className.ios);
876
- },
877
-
878
890
  // container
879
891
  pushed: function () {
880
892
  $context.addClass(className.pushed);
@@ -924,11 +936,6 @@
924
936
  ;
925
937
  },
926
938
 
927
- // ios scroll on html not document
928
- ios: function () {
929
- $html.removeClass(className.ios);
930
- },
931
-
932
939
  // context
933
940
  pushed: function () {
934
941
  $context.removeClass(className.pushed);
@@ -973,23 +980,6 @@
973
980
 
974
981
  return className.left;
975
982
  },
976
- transitionEvent: function () {
977
- var
978
- element = document.createElement('element'),
979
- transitions = {
980
- transition: 'transitionend',
981
- OTransition: 'oTransitionEnd',
982
- MozTransition: 'transitionend',
983
- WebkitTransition: 'webkitTransitionEnd',
984
- },
985
- transition
986
- ;
987
- for (transition in transitions) {
988
- if (element.style[transition] !== undefined) {
989
- return transitions[transition];
990
- }
991
- }
992
- },
993
983
  id: function () {
994
984
  return id;
995
985
  },
@@ -1067,20 +1057,6 @@
1067
1057
 
1068
1058
  return module.cache.isIE;
1069
1059
  },
1070
- ios: function () {
1071
- var
1072
- userAgent = navigator.userAgent,
1073
- isIOS = userAgent.match(regExp.ios),
1074
- isMobileChrome = userAgent.match(regExp.mobileChrome)
1075
- ;
1076
- if (isIOS && !isMobileChrome) {
1077
- module.verbose('Browser was found to be iOS', userAgent);
1078
-
1079
- return true;
1080
- }
1081
-
1082
- return false;
1083
- },
1084
1060
  mobile: function () {
1085
1061
  var
1086
1062
  userAgent = navigator.userAgent,
@@ -1243,7 +1219,7 @@
1243
1219
  });
1244
1220
  }
1245
1221
  clearTimeout(module.performance.timer);
1246
- module.performance.timer = setTimeout(module.performance.display, 500);
1222
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
1247
1223
  },
1248
1224
  display: function () {
1249
1225
  var
@@ -1256,9 +1232,6 @@
1256
1232
  totalTime += data['Execution Time'];
1257
1233
  });
1258
1234
  title += ' ' + totalTime + 'ms';
1259
- if (moduleSelector) {
1260
- title += ' \'' + moduleSelector + '\'';
1261
- }
1262
1235
  if (performance.length > 0) {
1263
1236
  console.groupCollapsed(title);
1264
1237
  if (console.table) {
@@ -1430,7 +1403,6 @@
1430
1403
  blurring: 'blurring',
1431
1404
  closing: 'closing',
1432
1405
  dimmed: 'dimmed',
1433
- ios: 'ios',
1434
1406
  locked: 'locked',
1435
1407
  pushable: 'pushable',
1436
1408
  pushed: 'pushed',
@@ -1463,8 +1435,6 @@
1463
1435
  },
1464
1436
 
1465
1437
  regExp: {
1466
- ios: /(iPad|iPhone|iPod)/g,
1467
- mobileChrome: /(CriOS)/g,
1468
1438
  mobile: /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g,
1469
1439
  },
1470
1440