less-rails-semantic_ui 1.10.4.0 → 1.11.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/assets/javascripts/semantic_ui/definitions/behaviors/visibility.js +84 -70
  3. data/assets/javascripts/semantic_ui/definitions/modules/dimmer.js +40 -2
  4. data/assets/javascripts/semantic_ui/definitions/modules/dropdown.js +34 -20
  5. data/assets/javascripts/semantic_ui/definitions/modules/modal.js +18 -14
  6. data/assets/javascripts/semantic_ui/definitions/modules/popup.js +70 -33
  7. data/assets/javascripts/semantic_ui/definitions/modules/search.js +27 -15
  8. data/assets/javascripts/semantic_ui/definitions/modules/sidebar.js +2 -5
  9. data/assets/javascripts/semantic_ui/definitions/modules/sticky.js +64 -48
  10. data/assets/javascripts/semantic_ui/definitions/modules/transition.js +57 -24
  11. data/assets/stylesheets/semantic_ui/definitions/collections/form.less +16 -2
  12. data/assets/stylesheets/semantic_ui/definitions/collections/grid.less +9 -10
  13. data/assets/stylesheets/semantic_ui/definitions/collections/menu.less +6 -5
  14. data/assets/stylesheets/semantic_ui/definitions/collections/table.less +4 -2
  15. data/assets/stylesheets/semantic_ui/definitions/elements/button.less +1 -0
  16. data/assets/stylesheets/semantic_ui/definitions/elements/icon.less +2 -8
  17. data/assets/stylesheets/semantic_ui/definitions/elements/image.less +9 -0
  18. data/assets/stylesheets/semantic_ui/definitions/elements/list.less +2 -2
  19. data/assets/stylesheets/semantic_ui/definitions/elements/segment.less +10 -1
  20. data/assets/stylesheets/semantic_ui/definitions/modules/dropdown.less +12 -4
  21. data/assets/stylesheets/semantic_ui/definitions/views/item.less +1 -2
  22. data/assets/stylesheets/semantic_ui/themes/basic/elements/icon.overrides +156 -156
  23. data/assets/stylesheets/semantic_ui/themes/basic/elements/icon.variables +7 -0
  24. data/assets/stylesheets/semantic_ui/themes/default/collections/menu.variables +5 -0
  25. data/assets/stylesheets/semantic_ui/themes/default/elements/icon.overrides +0 -12
  26. data/assets/stylesheets/semantic_ui/themes/default/elements/icon.variables +10 -1
  27. data/assets/stylesheets/semantic_ui/themes/default/globals/site.variables +3 -0
  28. data/assets/stylesheets/semantic_ui/themes/default/modules/dropdown.variables +4 -1
  29. data/assets/stylesheets/semantic_ui/themes/default/modules/transition.overrides +50 -50
  30. data/assets/stylesheets/semantic_ui/themes/default/views/item.variables +3 -3
  31. data/assets/stylesheets/semantic_ui/themes/material/elements/button.overrides +3 -0
  32. data/lib/generators/semantic_ui/install/templates/theme.config +0 -12
  33. data/lib/less/rails/semantic_ui/version.rb +1 -1
  34. data/tasks/update.rake +4 -0
  35. metadata +2 -2
@@ -30,7 +30,9 @@ $.fn.sticky = function(parameters) {
30
30
  $allModules
31
31
  .each(function() {
32
32
  var
33
- settings = $.extend(true, {}, $.fn.sticky.settings, parameters),
33
+ settings = ( $.isPlainObject(parameters) )
34
+ ? $.extend(true, {}, $.fn.sticky.settings, parameters)
35
+ : $.extend({}, $.fn.sticky.settings),
34
36
 
35
37
  className = settings.className,
36
38
  namespace = settings.namespace,
@@ -62,35 +64,14 @@ $.fn.sticky = function(parameters) {
62
64
  module = {
63
65
 
64
66
  initialize: function() {
65
- if(settings.context) {
66
- $context = $(settings.context);
67
- }
68
- else {
69
- $context = $container;
70
- }
71
- if($context.length === 0) {
72
- module.error(error.invalidContext, settings.context, $module);
73
- return;
74
- }
67
+
68
+ module.determineContext();
75
69
  module.verbose('Initializing sticky', settings, $container);
76
- module.save.positions();
77
70
 
78
- // error conditions
79
- if( module.is.hidden() ) {
80
- module.error(error.visible, $module);
81
- }
82
- if(module.cache.element.height > module.cache.context.height) {
83
- module.reset();
84
- module.error(error.elementSize, $module);
85
- return;
86
- }
71
+ module.save.positions();
72
+ module.checkErrors();
73
+ module.bind.events();
87
74
 
88
- $window
89
- .on('resize' + eventNamespace, module.event.resize)
90
- ;
91
- $scroll
92
- .on('scroll' + eventNamespace, module.event.scroll)
93
- ;
94
75
  if(settings.observeChanges) {
95
76
  module.observeChanges();
96
77
  }
@@ -111,15 +92,9 @@ $.fn.sticky = function(parameters) {
111
92
  if(observer) {
112
93
  observer.disconnect();
113
94
  }
114
- $window
115
- .off('resize' + eventNamespace, module.event.resize)
116
- ;
117
- $scroll
118
- .off('scroll' + eventNamespace, module.event.scroll)
119
- ;
120
- $module
121
- .removeData(moduleNamespace)
122
- ;
95
+ $window.off('resize' + eventNamespace, module.event.resize);
96
+ $scroll.off('scroll' + eventNamespace, module.event.scroll);
97
+ $module.removeData(moduleNamespace);
123
98
  },
124
99
 
125
100
  observeChanges: function() {
@@ -146,6 +121,37 @@ $.fn.sticky = function(parameters) {
146
121
  }
147
122
  },
148
123
 
124
+ determineContext: function() {
125
+ if(settings.context) {
126
+ $context = $(settings.context);
127
+ }
128
+ else {
129
+ $context = $container;
130
+ }
131
+ if($context.length === 0) {
132
+ module.error(error.invalidContext, settings.context, $module);
133
+ return;
134
+ }
135
+ },
136
+
137
+ checkErrors: function() {
138
+ if( module.is.hidden() ) {
139
+ module.error(error.visible, $module);
140
+ }
141
+ if(module.cache.element.height > module.cache.context.height) {
142
+ module.reset();
143
+ module.error(error.elementSize, $module);
144
+ return;
145
+ }
146
+ },
147
+
148
+ bind: {
149
+ events: function() {
150
+ $window.on('resize' + eventNamespace, module.event.resize);
151
+ $scroll.on('scroll' + eventNamespace, module.event.scroll);
152
+ }
153
+ },
154
+
149
155
  event: {
150
156
  resize: function() {
151
157
  requestAnimationFrame(function() {
@@ -177,9 +183,7 @@ $.fn.sticky = function(parameters) {
177
183
  $element = $('<div/>'),
178
184
  element = $element.get()
179
185
  ;
180
- $element
181
- .addClass(className.supported)
182
- ;
186
+ $element.addClass(className.supported);
183
187
  return($element.css('position').match('sticky'));
184
188
  }
185
189
  },
@@ -203,8 +207,9 @@ $.fn.sticky = function(parameters) {
203
207
  height : $module.outerHeight()
204
208
  },
205
209
  context = {
206
- offset: $context.offset(),
207
- height: $context.outerHeight()
210
+ offset : $context.offset(),
211
+ height : $context.outerHeight(),
212
+ bottomPadding : parseInt($context.css('padding-bottom'), 10)
208
213
  }
209
214
  ;
210
215
  module.cache = {
@@ -221,9 +226,10 @@ $.fn.sticky = function(parameters) {
221
226
  bottom : element.offset.top + element.height
222
227
  },
223
228
  context: {
224
- top : context.offset.top,
225
- height : context.height,
226
- bottom : context.offset.top + context.height
229
+ top : context.offset.top,
230
+ height : context.height,
231
+ bottomPadding : context.bottomPadding,
232
+ bottom : context.offset.top + context.height - context.bottomPadding
227
233
  }
228
234
  };
229
235
  module.set.containerSize();
@@ -309,7 +315,9 @@ $.fn.sticky = function(parameters) {
309
315
  else {
310
316
  module.debug('Settings container size', module.cache.context.height);
311
317
  if( Math.abs($container.height() - module.cache.context.height) > 5) {
312
- $container.height(module.cache.context.height);
318
+ $container.css({
319
+ height: module.cache.context.height
320
+ });
313
321
  }
314
322
  }
315
323
  },
@@ -389,7 +397,12 @@ $.fn.sticky = function(parameters) {
389
397
  if(elementVisible) {
390
398
 
391
399
  if( module.is.initialPosition() ) {
392
- if(scroll.top >= element.top) {
400
+ if(scroll.top >= context.bottom) {
401
+ console.log(scroll.top, context.bottom);
402
+ module.debug('Element bottom of container');
403
+ module.bindBottom();
404
+ }
405
+ else if(scroll.top >= element.top) {
393
406
  module.debug('Element passed, fixing element to page');
394
407
  module.fixTop();
395
408
  }
@@ -455,7 +468,7 @@ $.fn.sticky = function(parameters) {
455
468
  $module
456
469
  .css('left' , '')
457
470
  .css('top' , '')
458
- .css('bottom' , '')
471
+ .css('margin-bottom' , '')
459
472
  .removeClass(className.fixed)
460
473
  .removeClass(className.bottom)
461
474
  .addClass(className.bound)
@@ -470,7 +483,7 @@ $.fn.sticky = function(parameters) {
470
483
  $module
471
484
  .css('left' , '')
472
485
  .css('top' , '')
473
- .css('bottom' , '')
486
+ .css('margin-bottom' , module.cache.context.bottomPadding)
474
487
  .removeClass(className.fixed)
475
488
  .removeClass(className.top)
476
489
  .addClass(className.bound)
@@ -491,6 +504,7 @@ $.fn.sticky = function(parameters) {
491
504
  module.set.offset();
492
505
  $module
493
506
  .css('left', module.cache.element.left)
507
+ .css('bottom' , '')
494
508
  .removeClass(className.bound)
495
509
  .removeClass(className.bottom)
496
510
  .addClass(className.fixed)
@@ -504,6 +518,7 @@ $.fn.sticky = function(parameters) {
504
518
  module.set.offset();
505
519
  $module
506
520
  .css('left', module.cache.element.left)
521
+ .css('bottom' , '')
507
522
  .removeClass(className.bound)
508
523
  .removeClass(className.top)
509
524
  .addClass(className.fixed)
@@ -743,6 +758,7 @@ $.fn.sticky.settings = {
743
758
  pushing : false,
744
759
  context : false,
745
760
  scrollContext : window,
761
+
746
762
  offset : 0,
747
763
  bottomOffset : 0,
748
764
 
@@ -187,7 +187,7 @@ $.fn.transition = function() {
187
187
 
188
188
  reset: function() {
189
189
  module.debug('Resetting animation to beginning conditions');
190
- module.remove.animationEndCallback();
190
+ module.remove.animationCallbacks();
191
191
  module.restore.conditions();
192
192
  module.remove.animating();
193
193
  },
@@ -196,7 +196,7 @@ $.fn.transition = function() {
196
196
  module.debug('Queueing animation of', animation);
197
197
  module.queuing = true;
198
198
  $module
199
- .one(animationEnd + eventNamespace, function() {
199
+ .one(animationEnd + '.queue' + eventNamespace, function() {
200
200
  module.queuing = false;
201
201
  module.repaint();
202
202
  module.animate.apply(this, settings);
@@ -205,8 +205,8 @@ $.fn.transition = function() {
205
205
  },
206
206
 
207
207
  complete: function (event) {
208
- module.verbose('CSS animation complete', settings.animation);
209
- module.remove.animationEndCallback();
208
+ module.debug('Animation complete', settings.animation);
209
+ module.remove.completeCallback();
210
210
  module.remove.failSafe();
211
211
  if(!module.is.looping()) {
212
212
  if( module.is.outward() ) {
@@ -219,7 +219,6 @@ $.fn.transition = function() {
219
219
  module.verbose('Animation is outward, showing element');
220
220
  module.restore.conditions();
221
221
  module.show();
222
- module.set.display();
223
222
  settings.onShow.call(this);
224
223
  }
225
224
  else {
@@ -262,7 +261,7 @@ $.fn.transition = function() {
262
261
  module.save.conditions();
263
262
  }
264
263
  module.remove.direction();
265
- module.remove.animationEndCallback();
264
+ module.remove.completeCallback();
266
265
  if(module.can.transition() && !module.has.direction()) {
267
266
  module.set.direction();
268
267
  }
@@ -286,8 +285,8 @@ $.fn.transition = function() {
286
285
  ? duration + 'ms'
287
286
  : duration
288
287
  ;
289
- module.verbose('Setting animation duration', duration);
290
288
  if(duration || duration === 0) {
289
+ module.verbose('Setting animation duration', duration);
291
290
  $module
292
291
  .css({
293
292
  '-webkit-animation-duration': duration,
@@ -396,8 +395,9 @@ $.fn.transition = function() {
396
395
  module.verbose('Restoring original style attribute', module.cache.style);
397
396
  $module.attr('style', module.cache.style);
398
397
  }
399
- if(module.is.looping()) {
400
- module.remove.looping();
398
+ else {
399
+ module.verbose('Clearing style attribute');
400
+ $module.removeAttr('style');
401
401
  }
402
402
  module.verbose('Restoring original attributes', module.cache);
403
403
  }
@@ -430,8 +430,15 @@ $.fn.transition = function() {
430
430
  })
431
431
  ;
432
432
  },
433
- animationEndCallback: function() {
434
- $module.off('.complete');
433
+ animationCallbacks: function() {
434
+ module.remove.queueCallback();
435
+ module.remove.completeCallback();
436
+ },
437
+ queueCallback: function() {
438
+ $module.off('.queue' + eventNamespace)
439
+ },
440
+ completeCallback: function() {
441
+ $module.off('.complete' + eventNamespace);
435
442
  },
436
443
  display: function() {
437
444
  $module.css('display', '');
@@ -456,10 +463,12 @@ $.fn.transition = function() {
456
463
  },
457
464
  looping: function() {
458
465
  module.debug('Transitions are no longer looping');
459
- $module
460
- .removeClass(className.looping)
461
- ;
462
- module.forceRepaint();
466
+ if( module.is.looping() ) {
467
+ module.reset();
468
+ $module
469
+ .removeClass(className.looping)
470
+ ;
471
+ }
463
472
  },
464
473
  transition: function() {
465
474
  $module
@@ -660,6 +669,8 @@ $.fn.transition = function() {
660
669
  .css('display')
661
670
  ;
662
671
  module.verbose('Determining final display state', displayType);
672
+ module.save.displayType(displayType);
673
+
663
674
  $clone.remove();
664
675
  if(currentAnimation != inAnimation) {
665
676
  module.debug('Direction exists for animation', animation);
@@ -673,7 +684,6 @@ $.fn.transition = function() {
673
684
  module.debug('Static animation found', animation, displayType);
674
685
  directionExists = false;
675
686
  }
676
- module.save.displayType(displayType);
677
687
  module.save.transitionExists(animation, directionExists);
678
688
  }
679
689
  return (transitionExists !== undefined)
@@ -731,24 +741,47 @@ $.fn.transition = function() {
731
741
  module.verbose('Showing element', display);
732
742
  module.remove.hidden();
733
743
  module.set.visible();
744
+ module.set.display();
734
745
  module.repaint();
735
746
  },
736
747
 
737
- start: function() {
748
+ toggle: function() {
749
+ if( module.is.visible() ) {
750
+ module.hide();
751
+ }
752
+ else {
753
+ module.show();
754
+ }
755
+ },
756
+
757
+ stop: function() {
758
+ module.debug('Stopping current animation');
759
+ $module.trigger(animationEnd);
760
+ },
761
+
762
+ stopAll: function() {
763
+ module.debug('Stopping all animation');
764
+ module.remove.queueCallback();
765
+ $module.trigger(animationEnd);
766
+ },
767
+
768
+ clear: {
769
+ queue: function() {
770
+ module.debug('Clearing animation queue')
771
+ module.remove.queueCallback();
772
+ }
773
+ },
774
+
775
+ enable: function() {
738
776
  module.verbose('Starting animation');
739
777
  $module.removeClass(className.disabled);
740
778
  },
741
779
 
742
- stop: function() {
780
+ disable: function() {
743
781
  module.debug('Stopping animation');
744
782
  $module.addClass(className.disabled);
745
783
  },
746
784
 
747
- toggle: function() {
748
- module.debug('Toggling play status');
749
- $module.toggleClass(className.disabled);
750
- },
751
-
752
785
  setting: function(name, value) {
753
786
  module.debug('Changing setting', name, value);
754
787
  if( $.isPlainObject(name) ) {
@@ -818,7 +851,7 @@ $.fn.transition = function() {
818
851
  });
819
852
  }
820
853
  clearTimeout(module.performance.timer);
821
- module.performance.timer = setTimeout(module.performance.display, 600);
854
+ module.performance.timer = setTimeout(module.performance.display, 100);
822
855
  },
823
856
  display: function() {
824
857
  var
@@ -102,6 +102,7 @@
102
102
  .ui.form input[type="email"],
103
103
  .ui.form input[type="number"],
104
104
  .ui.form input[type="password"],
105
+ .ui.form input[type="search"],
105
106
  .ui.form input[type="tel"],
106
107
  .ui.form input[type="time"],
107
108
  .ui.form input[type="text"],
@@ -117,6 +118,7 @@
117
118
  .ui.form input[type="email"],
118
119
  .ui.form input[type="number"],
119
120
  .ui.form input[type="password"],
121
+ .ui.form input[type="search"],
120
122
  .ui.form input[type="tel"],
121
123
  .ui.form input[type="time"],
122
124
  .ui.form input[type="text"],
@@ -125,7 +127,7 @@
125
127
  margin: 0em;
126
128
  outline: none;
127
129
  -webkit-appearance: none;
128
- -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
130
+ tap-highlight-color: rgba(255, 255, 255, 0);
129
131
 
130
132
  line-height: @inputLineHeight;
131
133
  padding: @inputPadding;
@@ -144,7 +146,7 @@
144
146
  .ui.form textarea {
145
147
  margin: 0em;
146
148
  -webkit-appearance: none;
147
- -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
149
+ tap-highlight-color: rgba(255, 255, 255, 0);
148
150
 
149
151
  padding: @textAreaPadding;
150
152
  font-size: @textAreaFontSize;
@@ -304,6 +306,7 @@
304
306
  .ui.form input[type="email"]:focus,
305
307
  .ui.form input[type="number"]:focus,
306
308
  .ui.form input[type="password"]:focus,
309
+ .ui.form input[type="search"]:focus,
307
310
  .ui.form input[type="tel"]:focus,
308
311
  .ui.form input[type="time"]:focus,
309
312
  .ui.form input[type="text"]:focus,
@@ -365,23 +368,27 @@
365
368
  }
366
369
 
367
370
  .ui.form .fields.error .field textarea,
371
+ .ui.form .fields.error .field select,
368
372
  .ui.form .fields.error .field input:not([type]),
369
373
  .ui.form .fields.error .field input[type="date"],
370
374
  .ui.form .fields.error .field input[type="datetime-local"],
371
375
  .ui.form .fields.error .field input[type="email"],
372
376
  .ui.form .fields.error .field input[type="number"],
373
377
  .ui.form .fields.error .field input[type="password"],
378
+ .ui.form .fields.error .field input[type="search"],
374
379
  .ui.form .fields.error .field input[type="tel"],
375
380
  .ui.form .fields.error .field input[type="time"],
376
381
  .ui.form .fields.error .field input[type="text"],
377
382
  .ui.form .fields.error .field input[type="url"],
378
383
  .ui.form .field.error textarea,
384
+ .ui.form .field.error select,
379
385
  .ui.form .field.error input:not([type]),
380
386
  .ui.form .field.error input[type="date"],
381
387
  .ui.form .field.error input[type="datetime-local"],
382
388
  .ui.form .field.error input[type="email"],
383
389
  .ui.form .field.error input[type="number"],
384
390
  .ui.form .field.error input[type="password"],
391
+ .ui.form .field.error input[type="search"],
385
392
  .ui.form .field.error input[type="tel"],
386
393
  .ui.form .field.error input[type="time"],
387
394
  .ui.form .field.error input[type="text"],
@@ -393,12 +400,14 @@
393
400
  box-shadow: @inputErrorBoxShadow;
394
401
  }
395
402
  .ui.form .field.error textarea:focus,
403
+ .ui.form .field.error select:focus,
396
404
  .ui.form .field.error input:not([type]):focus,
397
405
  .ui.form .field.error input[type="date"]:focus,
398
406
  .ui.form .field.error input[type="datetime-local"]:focus,
399
407
  .ui.form .field.error input[type="email"]:focus,
400
408
  .ui.form .field.error input[type="number"]:focus,
401
409
  .ui.form .field.error input[type="password"]:focus,
410
+ .ui.form .field.error input[type="search"]:focus,
402
411
  .ui.form .field.error input[type="tel"]:focus,
403
412
  .ui.form .field.error input[type="time"]:focus,
404
413
  .ui.form .field.error input[type="text"]:focus,
@@ -411,6 +420,11 @@
411
420
  box-shadow: @inputErrorFocusBoxShadow;
412
421
  }
413
422
 
423
+ /* Preserve Native Select Stylings */
424
+ .ui.form .field.error select {
425
+ -webkit-appearance: menulist-button;
426
+ }
427
+
414
428
  /*------------------
415
429
  Dropdown Error
416
430
  --------------------*/