semantic-ui-rails 0.14.0 → 0.16.1

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/semantic-ui/modules/accordion.js +1 -1
  3. data/app/assets/javascripts/semantic-ui/modules/behavior/form.js +2 -4
  4. data/app/assets/javascripts/semantic-ui/modules/chatroom.js +1 -2
  5. data/app/assets/javascripts/semantic-ui/modules/checkbox.js +8 -6
  6. data/app/assets/javascripts/semantic-ui/modules/dimmer.js +1 -1
  7. data/app/assets/javascripts/semantic-ui/modules/dropdown.js +50 -20
  8. data/app/assets/javascripts/semantic-ui/modules/modal.js +21 -4
  9. data/app/assets/javascripts/semantic-ui/modules/nag.js +1 -1
  10. data/app/assets/javascripts/semantic-ui/modules/popup.js +1 -1
  11. data/app/assets/javascripts/semantic-ui/modules/rating.js +1 -1
  12. data/app/assets/javascripts/semantic-ui/modules/search.js +1 -1
  13. data/app/assets/javascripts/semantic-ui/modules/shape.js +1 -1
  14. data/app/assets/javascripts/semantic-ui/modules/sidebar.js +1 -1
  15. data/app/assets/javascripts/semantic-ui/modules/tab.js +1 -1
  16. data/app/assets/javascripts/semantic-ui/modules/transition.js +2 -2
  17. data/app/assets/javascripts/semantic-ui/modules/video.js +1 -1
  18. data/app/assets/stylesheets/semantic-ui/collections/form.less +87 -11
  19. data/app/assets/stylesheets/semantic-ui/collections/menu.less +2 -5
  20. data/app/assets/stylesheets/semantic-ui/collections/message.less +17 -7
  21. data/app/assets/stylesheets/semantic-ui/collections/table.less +4 -1
  22. data/app/assets/stylesheets/semantic-ui/elements/basic.icon.less +2 -2
  23. data/app/assets/stylesheets/semantic-ui/elements/icon.less +8 -3
  24. data/app/assets/stylesheets/semantic-ui/elements/input.less +10 -6
  25. data/app/assets/stylesheets/semantic-ui/elements/reveal.less +54 -20
  26. data/app/assets/stylesheets/semantic-ui/elements/segment.less +1 -1
  27. data/app/assets/stylesheets/semantic-ui/elements/step.less +51 -34
  28. data/app/assets/stylesheets/semantic-ui/modules/checkbox.less +20 -19
  29. data/app/assets/stylesheets/semantic-ui/modules/dropdown.less +12 -6
  30. data/app/assets/stylesheets/semantic-ui/modules/modal.less +1 -1
  31. data/app/assets/stylesheets/semantic-ui/modules/rating.less +0 -21
  32. data/app/assets/stylesheets/semantic-ui/modules/sidebar.less +10 -5
  33. data/app/assets/stylesheets/semantic-ui/modules/transition.less +1 -1
  34. data/app/assets/stylesheets/semantic-ui/views/item.less +1 -1
  35. data/lib/semantic/ui/rails/version.rb +1 -1
  36. data/semantic.thor +2 -2
  37. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0d077e82f486a0372ea9f41c789e5c53a718491
4
- data.tar.gz: d1602331975cbafd98f597f493c145dbc01fa043
3
+ metadata.gz: 3a5c7efdc48c48fbbc6a8ccff466c45b5475c7cc
4
+ data.tar.gz: a5510dd4526e13ed7fde423f2493314be8b666c7
5
5
  SHA512:
6
- metadata.gz: 59ae59df1719d35af5c21a4503a1f81be1087259229eb7157f795956ab7b6a672237c6bb102f5415de6da41319982805085da3bbbf1c70ea55280ed7bda86b03
7
- data.tar.gz: 8f71837e6a166428b94d7d9b1d2def58174b7558830e493f119e2cef9b8603395ef365e7006b7bf0b3da681cf24f86d154b97bf15c88f7b07e7d4381eb07f8a8
6
+ metadata.gz: 6a4ee41d4f0f787f44234765fa9e4a5acebebcf3deabff51d59ac18c3bfd67fb075374d0abd6fc2fe2657f768e87db80770858f115732d535e0da5b8ddb29668
7
+ data.tar.gz: 91b9978260abdb8fdf79538fe1a77538b2166b3557dc2692ea5a5967b7d68335e0269a9df3eb2c921e7729f14a9372f1504ecb09faa6c19635ee5446060c8f8b
@@ -386,7 +386,7 @@ $.fn.accordion.settings = {
386
386
  name : 'Accordion',
387
387
  namespace : 'accordion',
388
388
 
389
- debug : true,
389
+ debug : false,
390
390
  verbose : true,
391
391
  performance : true,
392
392
 
@@ -107,12 +107,10 @@ $.fn.form = function(fields, parameters) {
107
107
  ;
108
108
  $field
109
109
  .each(function() {
110
- var
110
+ var
111
111
  type = $(this).prop('type'),
112
112
  inputEvent = module.get.changeEvent(type)
113
113
  ;
114
- if(settings.inline == true) {
115
- }
116
114
  $(this)
117
115
  .on(inputEvent + eventNamespace, module.event.field.change)
118
116
  ;
@@ -201,7 +199,7 @@ $.fn.form = function(fields, parameters) {
201
199
 
202
200
  get: {
203
201
  changeEvent: function(type) {
204
- if(type == 'checkbox' || type == 'radio') {
202
+ if(type == 'checkbox' || type == 'radio' || type == 'hidden') {
205
203
  return 'change';
206
204
  }
207
205
  else {
@@ -588,8 +588,7 @@ $.fn.chatroom = function(parameters) {
588
588
  }
589
589
  })
590
590
  ;
591
-
592
- return (returnedValue)
591
+ return (returnedValue !== undefined)
593
592
  ? returnedValue
594
593
  : this
595
594
  ;
@@ -130,11 +130,13 @@ $.fn.checkbox = function(parameters) {
130
130
 
131
131
  toggle: function(event) {
132
132
  module.verbose('Determining new checkbox state');
133
- if( module.is.disabled() ) {
134
- module.enable();
135
- }
136
- else if( module.is.enabled() && module.can.disable() ) {
137
- module.disable();
133
+ if( !$input.prop('disabled') ) {
134
+ if( module.is.disabled() ) {
135
+ module.enable();
136
+ }
137
+ else if( module.is.enabled() && module.can.disable() ) {
138
+ module.disable();
139
+ }
138
140
  }
139
141
  },
140
142
  setting: function(name, value) {
@@ -317,8 +319,8 @@ $.fn.checkbox.settings = {
317
319
  name : 'Checkbox',
318
320
  namespace : 'checkbox',
319
321
 
322
+ debug : false,
320
323
  verbose : true,
321
- debug : true,
322
324
  performance : true,
323
325
 
324
326
  // delegated event context
@@ -543,7 +543,7 @@ $.fn.dimmer.settings = {
543
543
  name : 'Dimmer',
544
544
  namespace : 'dimmer',
545
545
 
546
- debug : true,
546
+ debug : false,
547
547
  verbose : true,
548
548
  performance : true,
549
549
 
@@ -181,17 +181,22 @@ $.fn.dropdown = function(parameters) {
181
181
 
182
182
  mouseenter: function(event) {
183
183
  var
184
- $currentMenu = $(this).find(selector.menu),
184
+ $currentMenu = $(this).find(selector.submenu),
185
185
  $otherMenus = $(this).siblings(selector.item).children(selector.menu)
186
186
  ;
187
- if( $currentMenu.size() > 0 ) {
187
+ if($currentMenu.length > 0 || $otherMenus.length > 0) {
188
188
  clearTimeout(module.itemTimer);
189
- module.itemTimer = setTimeout(function() {
190
- module.animate.hide(false, $otherMenus);
191
- module.verbose('Showing sub-menu', $currentMenu);
192
- module.animate.show(false, $currentMenu);
189
+ module.itemTimer = setTimeout(function() {
190
+ if($otherMenus.length > 0) {
191
+ module.animate.hide(false, $otherMenus.filter(':visible'));
192
+ }
193
+ if($currentMenu.length > 0) {
194
+ module.verbose('Showing sub-menu', $currentMenu);
195
+ module.animate.show(false, $currentMenu);
196
+ }
193
197
  }, settings.delay.show * 2);
194
198
  event.preventDefault();
199
+ event.stopPropagation();
195
200
  }
196
201
  },
197
202
 
@@ -216,7 +221,9 @@ $.fn.dropdown = function(parameters) {
216
221
  : $choice.text(),
217
222
  value = ( $choice.data(metadata.value) !== undefined)
218
223
  ? $choice.data(metadata.value)
219
- : text.toLowerCase(),
224
+ : (typeof text === 'string')
225
+ ? text.toLowerCase()
226
+ : text,
220
227
  callback = function() {
221
228
  module.determine.selectAction(text, value);
222
229
  $.proxy(settings.onChange, element)(value, text);
@@ -332,7 +339,7 @@ $.fn.dropdown = function(parameters) {
332
339
  : $module.data(metadata.value)
333
340
  ;
334
341
  },
335
- item: function(value) {
342
+ item: function(value, strict) {
336
343
  var
337
344
  $selectedItem = false
338
345
  ;
@@ -342,6 +349,13 @@ $.fn.dropdown = function(parameters) {
342
349
  ? module.get.value()
343
350
  : module.get.text()
344
351
  ;
352
+ if(strict === undefined && value === '') {
353
+ module.debug('Ambiguous dropdown value using strict type check', value);
354
+ strict = true;
355
+ }
356
+ else {
357
+ strict = strict || false;
358
+ }
345
359
  if(value !== undefined) {
346
360
  $item
347
361
  .each(function() {
@@ -352,13 +366,25 @@ $.fn.dropdown = function(parameters) {
352
366
  : $choice.text(),
353
367
  optionValue = ( $choice.data(metadata.value) !== undefined )
354
368
  ? $choice.data(metadata.value)
355
- : optionText.toLowerCase()
369
+ : (typeof optionText === 'string')
370
+ ? optionText.toLowerCase()
371
+ : optionText
356
372
  ;
357
- if( optionValue == value ) {
358
- $selectedItem = $(this);
373
+ if(strict) {
374
+ if( optionValue === value ) {
375
+ $selectedItem = $(this);
376
+ }
377
+ else if( !$selectedItem && optionText === value ) {
378
+ $selectedItem = $(this);
379
+ }
359
380
  }
360
- else if( !$selectedItem && optionText == value ) {
361
- $selectedItem = $(this);
381
+ else {
382
+ if( optionValue == value ) {
383
+ $selectedItem = $(this);
384
+ }
385
+ else if( !$selectedItem && optionText == value ) {
386
+ $selectedItem = $(this);
387
+ }
362
388
  }
363
389
  })
364
390
  ;
@@ -416,7 +442,10 @@ $.fn.dropdown = function(parameters) {
416
442
  value: function(value) {
417
443
  module.debug('Adding selected value to hidden input', value, $input);
418
444
  if($input.size() > 0) {
419
- $input.val(value);
445
+ $input
446
+ .val(value)
447
+ .trigger('change')
448
+ ;
420
449
  }
421
450
  else {
422
451
  $module.data(metadata.value, value);
@@ -830,7 +859,7 @@ $.fn.dropdown = function(parameters) {
830
859
  })
831
860
  ;
832
861
 
833
- return (returnedValue)
862
+ return (returnedValue !== undefined)
834
863
  ? returnedValue
835
864
  : this
836
865
  ;
@@ -841,8 +870,8 @@ $.fn.dropdown.settings = {
841
870
  name : 'Dropdown',
842
871
  namespace : 'dropdown',
843
872
 
873
+ debug : false,
844
874
  verbose : true,
845
- debug : true,
846
875
  performance : true,
847
876
 
848
877
  on : 'click',
@@ -875,10 +904,11 @@ $.fn.dropdown.settings = {
875
904
  },
876
905
 
877
906
  selector : {
878
- menu : '.menu',
879
- item : '.menu > .item',
880
- text : '> .text',
881
- input : '> input[type="hidden"]'
907
+ menu : '.menu',
908
+ submenu : '> .menu',
909
+ item : '.menu > .item',
910
+ text : '> .text',
911
+ input : '> input[type="hidden"]'
882
912
  },
883
913
 
884
914
  className : {
@@ -25,6 +25,12 @@ $.fn.modal = function(parameters) {
25
25
  methodInvoked = (typeof query == 'string'),
26
26
  queryArguments = [].slice.call(arguments, 1),
27
27
 
28
+ requestAnimationFrame = window.requestAnimationFrame
29
+ || window.mozRequestAnimationFrame
30
+ || window.webkitRequestAnimationFrame
31
+ || window.msRequestAnimationFrame
32
+ || function(callback) { setTimeout(callback, 0); },
33
+
28
34
  returnedValue
29
35
  ;
30
36
 
@@ -237,7 +243,9 @@ $.fn.modal = function(parameters) {
237
243
  : function(){}
238
244
  ;
239
245
  if( !module.is.active() ) {
240
- module.cacheSizes();
246
+ if(module.cache === undefined) {
247
+ module.cacheSizes();
248
+ }
241
249
  module.set.position();
242
250
  module.set.screenHeight();
243
251
  module.set.type();
@@ -247,10 +255,12 @@ $.fn.modal = function(parameters) {
247
255
  module.hideOthers(module.showModal);
248
256
  }
249
257
  else {
258
+ $.proxy(settings.onShow, element)();
250
259
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
251
260
  module.debug('Showing modal with css animations');
252
261
  $module
253
262
  .transition(settings.transition + ' in', settings.duration, function() {
263
+ $.proxy(settings.onVisible, element)();
254
264
  module.set.active();
255
265
  callback();
256
266
  })
@@ -260,12 +270,12 @@ $.fn.modal = function(parameters) {
260
270
  module.debug('Showing modal with javascript');
261
271
  $module
262
272
  .fadeIn(settings.duration, settings.easing, function() {
273
+ $.proxy(settings.onVisible, element)();
263
274
  module.set.active();
264
275
  callback();
265
276
  })
266
277
  ;
267
278
  }
268
- $.proxy(settings.onShow, element)();
269
279
  }
270
280
  }
271
281
  else {
@@ -327,9 +337,11 @@ $.fn.modal = function(parameters) {
327
337
  }
328
338
  module.debug('Hiding modal');
329
339
  module.remove.keyboardShortcuts();
340
+ $.proxy(settings.onHide, element)();
330
341
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
331
342
  $module
332
343
  .transition(settings.transition + ' out', settings.duration, function() {
344
+ $.proxy(settings.onHidden, element)();
333
345
  module.remove.active();
334
346
  module.restore.focus();
335
347
  callback();
@@ -339,13 +351,13 @@ $.fn.modal = function(parameters) {
339
351
  else {
340
352
  $module
341
353
  .fadeOut(settings.duration, settings.easing, function() {
354
+ $.proxy(settings.onHidden, element)();
342
355
  module.remove.active();
343
356
  module.restore.focus();
344
357
  callback();
345
358
  })
346
359
  ;
347
360
  }
348
- $.proxy(settings.onHide, element)();
349
361
  },
350
362
 
351
363
  hideAll: function(callback) {
@@ -509,6 +521,7 @@ $.fn.modal = function(parameters) {
509
521
  },
510
522
 
511
523
  setting: function(name, value) {
524
+ module.debug('Changing setting', name, value);
512
525
  if( $.isPlainObject(name) ) {
513
526
  $.extend(true, settings, name);
514
527
  }
@@ -688,7 +701,7 @@ $.fn.modal.settings = {
688
701
  name : 'Modal',
689
702
  namespace : 'modal',
690
703
 
691
- debug : true,
704
+ debug : false,
692
705
  verbose : true,
693
706
  performance : true,
694
707
 
@@ -706,6 +719,10 @@ $.fn.modal.settings = {
706
719
 
707
720
  onShow : function(){},
708
721
  onHide : function(){},
722
+
723
+ onVisible : function(){},
724
+ onHidden : function(){},
725
+
709
726
  onApprove : function(){ return true; },
710
727
  onDeny : function(){ return true; },
711
728
 
@@ -482,8 +482,8 @@ $.fn.nag.settings = {
482
482
 
483
483
  name : 'Nag',
484
484
 
485
+ debug : false,
485
486
  verbose : true,
486
- debug : true,
487
487
  performance : true,
488
488
 
489
489
  namespace : 'Nag',
@@ -780,7 +780,7 @@ $.fn.popup = function(parameters) {
780
780
  $.fn.popup.settings = {
781
781
 
782
782
  name : 'Popup',
783
- debug : true,
783
+ debug : false,
784
784
  verbose : true,
785
785
  performance : true,
786
786
  namespace : 'popup',
@@ -374,7 +374,7 @@ $.fn.rating.settings = {
374
374
  namespace : 'rating',
375
375
 
376
376
  verbose : true,
377
- debug : true,
377
+ debug : false,
378
378
  performance : true,
379
379
 
380
380
  initialRating : 0,
@@ -587,7 +587,7 @@ $.fn.search.settings = {
587
587
  name : 'Search Module',
588
588
  namespace : 'search',
589
589
 
590
- debug : true,
590
+ debug : false,
591
591
  verbose : true,
592
592
  performance : true,
593
593
 
@@ -743,7 +743,7 @@ $.fn.shape.settings = {
743
743
  name : 'Shape',
744
744
 
745
745
  // debug content outputted to console
746
- debug : true,
746
+ debug : false,
747
747
 
748
748
  // verbose debug output
749
749
  verbose : true,
@@ -478,8 +478,8 @@ $.fn.sidebar.settings = {
478
478
  name : 'Sidebar',
479
479
  namespace : 'sidebar',
480
480
 
481
+ debug : false,
481
482
  verbose : true,
482
- debug : true,
483
483
  performance : true,
484
484
 
485
485
  useCSS : true,
@@ -647,8 +647,8 @@
647
647
  $.fn.tab.settings = {
648
648
 
649
649
  name : 'Tab',
650
+ debug : false,
650
651
  verbose : true,
651
- debug : true,
652
652
  performance : true,
653
653
  namespace : 'tab',
654
654
 
@@ -226,7 +226,7 @@ $.fn.transition = function() {
226
226
  var
227
227
  displayType = module.get.displayType()
228
228
  ;
229
- if(displayType !== 'block') {
229
+ if(displayType !== 'block' && displayType !== 'none') {
230
230
  module.verbose('Setting final visibility to', displayType);
231
231
  $module
232
232
  .css({
@@ -460,7 +460,7 @@ $.fn.transition = function() {
460
460
  animations = {
461
461
  'animation' :'animationend',
462
462
  'OAnimation' :'oAnimationEnd',
463
- 'MozAnimation' :'mozAnimationEnd',
463
+ 'MozAnimation' :'animationend',
464
464
  'WebkitAnimation' :'webkitAnimationEnd'
465
465
  },
466
466
  animation
@@ -412,7 +412,7 @@ $.fn.video.settings = {
412
412
  name : 'Video',
413
413
  namespace : 'video',
414
414
 
415
- debug : true,
415
+ debug : false,
416
416
  verbose : true,
417
417
  performance : true,
418
418
 
@@ -85,8 +85,8 @@
85
85
  .ui.form input[type="tel"] {
86
86
 
87
87
  margin: 0em;
88
- padding: 0.85em 1.2em;
89
- font-size: 0.875em;
88
+ padding: 0.65em 1em;
89
+ font-size: 1em;
90
90
 
91
91
  background-color: #FFFFFF;
92
92
  border: 1px solid rgba(0, 0, 0, 0.15);
@@ -556,6 +556,75 @@
556
556
  padding-right: 1%;
557
557
  }
558
558
 
559
+ .ui.form .fields .field:first-child {
560
+ padding-left: 0%;
561
+ }
562
+ .ui.form .fields .field:last-child {
563
+ padding-right: 0%;
564
+ }
565
+
566
+
567
+ /* Fields grid support */
568
+ .ui.form .fields .wide.field {
569
+ width: 6.25%;
570
+ padding-left: 1%;
571
+ padding-right: 1%;
572
+ }
573
+ .ui.form .fields .wide.field:first-child {
574
+ padding-left: 0%;
575
+ }
576
+ .ui.form .fields .wide.field:last-child {
577
+ padding-right: 0%;
578
+ }
579
+ .ui.form .fields > .one.wide.field {
580
+ width: 6.25%;
581
+ }
582
+ .ui.form .fields > .two.wide.field {
583
+ width: 12.5%;
584
+ }
585
+ .ui.form .fields > .three.wide.field {
586
+ width: 18.75%;
587
+ }
588
+ .ui.form .fields > .four.wide.field {
589
+ width: 25%;
590
+ }
591
+ .ui.form .fields > .five.wide.field {
592
+ width: 31.25%;
593
+ }
594
+ .ui.form .fields > .six.wide.field {
595
+ width: 37.5%;
596
+ }
597
+ .ui.form .fields > .seven.wide.field {
598
+ width: 43.75%;
599
+ }
600
+ .ui.form .fields > .eight.wide.field {
601
+ width: 50%;
602
+ }
603
+ .ui.form .fields > .nine.wide.field {
604
+ width: 56.25%;
605
+ }
606
+ .ui.form .fields > .ten.wide.field {
607
+ width: 62.5%;
608
+ }
609
+ .ui.form .fields > .eleven.wide.field {
610
+ width: 68.75%;
611
+ }
612
+ .ui.form .fields > .twelve.wide.field {
613
+ width: 75%;
614
+ }
615
+ .ui.form .fields > .thirteen.wide.field {
616
+ width: 81.25%;
617
+ }
618
+ .ui.form .fields > .fourteen.wide.field {
619
+ width: 87.5%;
620
+ }
621
+ .ui.form .fields > .fifteen.wide.field {
622
+ width: 93.75%;
623
+ }
624
+ .ui.form .fields > .sixteen.wide.field {
625
+ width: 100%;
626
+ }
627
+
559
628
  /* Swap to full width on mobile */
560
629
  @media only screen and (max-width : 767px) {
561
630
  .ui.form .two.fields > .fields,
@@ -565,21 +634,28 @@
565
634
  .ui.form .four.fields > .fields,
566
635
  .ui.form .four.fields > .field,
567
636
  .ui.form .five.fields > .fields,
568
- .ui.form .five.fields > .field {
637
+ .ui.form .five.fields > .field,
638
+ .ui.form .fields > .two.wide.field,
639
+ .ui.form .fields > .three.wide.field,
640
+ .ui.form .fields > .four.wide.field,
641
+ .ui.form .fields > .five.wide.field,
642
+ .ui.form .fields > .six.wide.field,
643
+ .ui.form .fields > .seven.wide.field,
644
+ .ui.form .fields > .eight.wide.field,
645
+ .ui.form .fields > .nine.wide.field,
646
+ .ui.form .fields > .ten.wide.field,
647
+ .ui.form .fields > .eleven.wide.field,
648
+ .ui.form .fields > .twelve.wide.field,
649
+ .ui.form .fields > .thirteen.wide.field,
650
+ .ui.form .fields > .fourteen.wide.field,
651
+ .ui.form .fields > .fifteen.wide.field,
652
+ .ui.form .fields > .sixteen.wide.field {
569
653
  width: 100%;
570
654
  padding-left: 0%;
571
655
  padding-right: 0%;
572
656
  }
573
657
  }
574
658
 
575
- .ui.form .fields .field:first-child {
576
- padding-left: 0%;
577
- }
578
- .ui.form .fields .field:last-child {
579
- padding-right: 0%;
580
- }
581
-
582
-
583
659
  /*--------------------
584
660
  Inline Fields
585
661
  ---------------------*/