fomantic-ui-sass 2.7.1 → 2.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/Rakefile +1 -0
  4. data/app/assets/javascripts/semantic-ui/accordion.js +20 -17
  5. data/app/assets/javascripts/semantic-ui/checkbox.js +18 -17
  6. data/app/assets/javascripts/semantic-ui/dropdown.js +48 -42
  7. data/app/assets/javascripts/semantic-ui/form.js +59 -28
  8. data/app/assets/javascripts/semantic-ui/modal.js +13 -1
  9. data/app/assets/javascripts/semantic-ui/progress.js +5 -5
  10. data/app/assets/javascripts/semantic-ui/search.js +34 -28
  11. data/app/assets/javascripts/semantic-ui/sidebar.js +5 -7
  12. data/app/assets/javascripts/semantic-ui/transition.js +46 -34
  13. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +1 -1
  14. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +7 -1
  15. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +1 -1
  16. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +112 -112
  17. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +1 -1
  18. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +66 -66
  19. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +21 -14
  20. data/app/assets/stylesheets/semantic-ui/elements/_container.scss +1 -1
  21. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +1 -1
  22. data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +1 -1
  23. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +2 -4
  24. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +464 -131
  25. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +1 -1
  26. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +8 -3
  27. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +227 -187
  28. data/app/assets/stylesheets/semantic-ui/elements/_list.scss +26 -12
  29. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +68 -19
  30. data/app/assets/stylesheets/semantic-ui/elements/_placeholder.scss +1 -1
  31. data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +1 -1
  32. data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +1 -1
  33. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +14 -17
  34. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +5 -1
  35. data/app/assets/stylesheets/semantic-ui/elements/_text.scss +26 -0
  36. data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +24 -118
  37. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +5 -5
  38. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +1 -1
  39. data/app/assets/stylesheets/semantic-ui/modules/_calendar.scss +1 -1
  40. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +1 -1
  41. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +3 -3
  42. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +6 -3
  43. data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +1 -1
  44. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +2 -1
  45. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +1 -1
  46. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +4 -4
  47. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +68 -21
  48. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +1 -1
  49. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +1 -1
  50. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +1 -1
  51. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +1 -1
  52. data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +1 -1
  53. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +1 -1
  54. data/app/assets/stylesheets/semantic-ui/modules/_toast.scss +1 -1
  55. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +1 -1
  56. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +1 -1
  57. data/app/assets/stylesheets/semantic-ui/views/_card.scss +1 -1
  58. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +1 -1
  59. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +1 -1
  60. data/app/assets/stylesheets/semantic-ui/views/_item.scss +1 -1
  61. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +1 -1
  62. data/fomantic-ui-sass.gemspec +1 -1
  63. data/lib/fomantic/ui/sass/version.rb +2 -2
  64. metadata +3 -3
@@ -271,7 +271,7 @@ $.fn.form = function(parameters) {
271
271
  if(!$field || $field.length === 0) {
272
272
  return true;
273
273
  }
274
- else if($field.is('input[type="checkbox"]')) {
274
+ else if($field.is(selector.checkbox)) {
275
275
  return !$field.is(':checked');
276
276
  }
277
277
  else {
@@ -552,10 +552,13 @@ $.fn.form = function(parameters) {
552
552
  }
553
553
  $.each(validation, function(fieldName, field) {
554
554
  identifier = field.identifier || fieldName;
555
- if( module.get.field(identifier)[0] == $field[0] ) {
556
- field.identifier = identifier;
557
- fieldValidation = field;
558
- }
555
+ $.each(module.get.field(identifier), function(index, groupField) {
556
+ if(groupField == $field[0]) {
557
+ field.identifier = identifier;
558
+ fieldValidation = field;
559
+ return false;
560
+ }
561
+ });
559
562
  });
560
563
  return fieldValidation || false;
561
564
  },
@@ -701,7 +704,7 @@ $.fn.form = function(parameters) {
701
704
  }
702
705
  validation = $.extend({}, validation, newValidation);
703
706
  },
704
- prompt: function(identifier, errors) {
707
+ prompt: function(identifier, errors, internal) {
705
708
  var
706
709
  $field = module.get.field(identifier),
707
710
  $fieldGroup = $field.closest($group),
@@ -713,9 +716,11 @@ $.fn.form = function(parameters) {
713
716
  : errors
714
717
  ;
715
718
  module.verbose('Adding field error state', identifier);
716
- $fieldGroup
717
- .addClass(className.error)
718
- ;
719
+ if(!internal) {
720
+ $fieldGroup
721
+ .addClass(className.error)
722
+ ;
723
+ }
719
724
  if(settings.inline) {
720
725
  if(!promptExists) {
721
726
  $prompt = settings.templates.prompt(errors);
@@ -977,24 +982,35 @@ $.fn.form = function(parameters) {
977
982
  module.debug('Using field name as identifier', identifier);
978
983
  field.identifier = identifier;
979
984
  }
980
- if($field.prop('disabled')) {
985
+ var isDisabled = true;
986
+ $.each($field, function(){
987
+ if(!$(this).prop('disabled')) {
988
+ isDisabled = false;
989
+ return false;
990
+ }
991
+ });
992
+ if(isDisabled) {
981
993
  module.debug('Field is disabled. Skipping', identifier);
982
- fieldValid = true;
983
994
  }
984
995
  else if(field.optional && module.is.blank($field)){
985
996
  module.debug('Field is optional and blank. Skipping', identifier);
986
- fieldValid = true;
987
997
  }
988
998
  else if(field.depends && module.is.empty($dependsField)) {
989
999
  module.debug('Field depends on another value that is not present or empty. Skipping', $dependsField);
990
- fieldValid = true;
991
1000
  }
992
1001
  else if(field.rules !== undefined) {
1002
+ $field.closest($group).removeClass(className.error);
993
1003
  $.each(field.rules, function(index, rule) {
994
- if( module.has.field(identifier) && !( module.validate.rule(field, rule) ) ) {
995
- module.debug('Field is invalid', identifier, rule.type);
996
- fieldErrors.push(module.get.prompt(rule, field));
997
- fieldValid = false;
1004
+ if( module.has.field(identifier)) {
1005
+ var invalidFields = module.validate.rule(field, rule,true) || [];
1006
+ if (invalidFields.length>0){
1007
+ module.debug('Field is invalid', identifier, rule.type);
1008
+ fieldErrors.push(module.get.prompt(rule, field));
1009
+ fieldValid = false;
1010
+ if(showErrors){
1011
+ $(invalidFields).closest($group).addClass(className.error);
1012
+ }
1013
+ }
998
1014
  }
999
1015
  });
1000
1016
  }
@@ -1007,7 +1023,7 @@ $.fn.form = function(parameters) {
1007
1023
  else {
1008
1024
  if(showErrors) {
1009
1025
  formErrors = formErrors.concat(fieldErrors);
1010
- module.add.prompt(identifier, fieldErrors);
1026
+ module.add.prompt(identifier, fieldErrors, true);
1011
1027
  settings.onInvalid.call($field, fieldErrors);
1012
1028
  }
1013
1029
  return false;
@@ -1016,26 +1032,41 @@ $.fn.form = function(parameters) {
1016
1032
  },
1017
1033
 
1018
1034
  // takes validation rule and returns whether field passes rule
1019
- rule: function(field, rule) {
1035
+ rule: function(field, rule, internal) {
1020
1036
  var
1021
1037
  $field = module.get.field(field.identifier),
1022
1038
  type = rule.type,
1023
- value = $field.val(),
1024
- isValid = true,
1025
1039
  ancillary = module.get.ancillaryValue(rule),
1026
1040
  ruleName = module.get.ruleName(rule),
1027
- ruleFunction = settings.rules[ruleName]
1041
+ ruleFunction = settings.rules[ruleName],
1042
+ invalidFields = [],
1043
+ isRadio = $field.is(selector.radio),
1044
+ isValid = function(field){
1045
+ var value = (isRadio ? $(field).filter(':checked').val() : $(field).val());
1046
+ // cast to string avoiding encoding special values
1047
+ value = (value === undefined || value === '' || value === null)
1048
+ ? ''
1049
+ : (settings.shouldTrim) ? $.trim(value + '') : String(value + '')
1050
+ ;
1051
+ return ruleFunction.call(field, value, ancillary);
1052
+ }
1028
1053
  ;
1029
1054
  if( !$.isFunction(ruleFunction) ) {
1030
1055
  module.error(error.noRule, ruleName);
1031
1056
  return;
1032
1057
  }
1033
- // cast to string avoiding encoding special values
1034
- value = (value === undefined || value === '' || value === null)
1035
- ? ''
1036
- : (settings.shouldTrim) ? $.trim(value + '') : String(value + '')
1037
- ;
1038
- return ruleFunction.call($field, value, ancillary);
1058
+ if(isRadio) {
1059
+ if (!isValid($field)) {
1060
+ invalidFields = $field;
1061
+ }
1062
+ } else {
1063
+ $.each($field, function (index, field) {
1064
+ if (!isValid(field)) {
1065
+ invalidFields.push(field);
1066
+ }
1067
+ });
1068
+ }
1069
+ return internal ? invalidFields : !(invalidFields.length>0);
1039
1070
  }
1040
1071
  },
1041
1072
 
@@ -79,6 +79,7 @@ $.fn.modal = function(parameters) {
79
79
  ignoreRepeatedEvents = false,
80
80
 
81
81
  initialMouseDownInModal,
82
+ initialMouseDownInScrollbar,
82
83
 
83
84
  elementEventNamespace,
84
85
  id,
@@ -281,6 +282,10 @@ $.fn.modal = function(parameters) {
281
282
  if(initialMouseDownInModal) {
282
283
  module.verbose('Mouse down event registered inside the modal');
283
284
  }
285
+ initialMouseDownInScrollbar = module.is.scrolling() && $(window).outerWidth() - settings.scrollbarWidth <= event.clientX;
286
+ if(initialMouseDownInScrollbar) {
287
+ module.verbose('Mouse down event registered inside the scrollbar');
288
+ }
284
289
  },
285
290
  mouseup: function(event) {
286
291
  if(!settings.closable) {
@@ -291,6 +296,10 @@ $.fn.modal = function(parameters) {
291
296
  module.debug('Dimmer clicked but mouse down was initially registered inside the modal');
292
297
  return;
293
298
  }
299
+ if(initialMouseDownInScrollbar){
300
+ module.debug('Dimmer clicked but mouse down was initially registered inside the scrollbar');
301
+ return;
302
+ }
294
303
  var
295
304
  $target = $(event.target),
296
305
  isInModal = ($target.closest(selector.modal).length > 0),
@@ -447,6 +456,7 @@ $.fn.modal = function(parameters) {
447
456
  module.debug('Hiding modal');
448
457
  if(settings.onHide.call(element, $(this)) === false) {
449
458
  module.verbose('Hide callback returned false cancelling hide');
459
+ ignoreRepeatedEvents = false;
450
460
  return false;
451
461
  }
452
462
 
@@ -592,7 +602,7 @@ $.fn.modal = function(parameters) {
592
602
 
593
603
  restore: {
594
604
  focus: function() {
595
- if($focusedElement && $focusedElement.length > 0) {
605
+ if($focusedElement && $focusedElement.length > 0 && settings.restoreFocus) {
596
606
  $focusedElement.focus();
597
607
  }
598
608
  }
@@ -1036,6 +1046,7 @@ $.fn.modal.settings = {
1036
1046
  detachable : true,
1037
1047
  closable : true,
1038
1048
  autofocus : true,
1049
+ restoreFocus : true,
1039
1050
 
1040
1051
  inverted : false,
1041
1052
  blurring : false,
@@ -1058,6 +1069,7 @@ $.fn.modal.settings = {
1058
1069
 
1059
1070
  // padding with edge of page
1060
1071
  padding : 50,
1072
+ scrollbarWidth: 10,
1061
1073
 
1062
1074
  // called before show animation
1063
1075
  onShow : function(){},
@@ -118,19 +118,19 @@ $.fn.progress = function(parameters) {
118
118
  value : $module.data(metadata.value)
119
119
  }
120
120
  ;
121
- if(data.percent) {
122
- module.debug('Current percent value set from metadata', data.percent);
123
- module.set.percent(data.percent);
124
- }
125
121
  if(data.total) {
126
122
  module.debug('Total value set from metadata', data.total);
127
123
  module.set.total(data.total);
128
124
  }
129
- if(data.value) {
125
+ if(!isNaN(data.value)) {
130
126
  module.debug('Current value set from metadata', data.value);
131
127
  module.set.value(data.value);
132
128
  module.set.progress(data.value);
133
129
  }
130
+ if(!isNaN(data.percent)) {
131
+ module.debug('Current percent value set from metadata', data.percent);
132
+ module.set.percent(data.percent);
133
+ }
134
134
  },
135
135
  settings: function() {
136
136
  if(settings.total !== false) {
@@ -412,6 +412,10 @@ $.fn.search = function(parameters) {
412
412
  settings.fullTextSearch = parameters.searchFullText;
413
413
  module.error(settings.error.oldSearchSyntax, element);
414
414
  }
415
+ if (settings.ignoreDiacritics && !String.prototype.normalize) {
416
+ settings.ignoreDiacritics = false;
417
+ module.error(error.noNormalize, element);
418
+ }
415
419
  },
416
420
  inputEvent: function() {
417
421
  var
@@ -506,6 +510,9 @@ $.fn.search = function(parameters) {
506
510
  },
507
511
  buttonPressed: function() {
508
512
  $searchButton.removeClass(className.pressed);
513
+ },
514
+ diacritics: function(text) {
515
+ return settings.ignoreDiacritics ? text.normalize('NFD').replace(/[\u0300-\u036f]/g, '') : text;
509
516
  }
510
517
  },
511
518
 
@@ -589,11 +596,12 @@ $.fn.search = function(parameters) {
589
596
  ;
590
597
  },
591
598
  object: function(searchTerm, source, searchFields) {
599
+ searchTerm = module.remove.diacritics(String(searchTerm));
592
600
  var
593
601
  results = [],
594
602
  exactResults = [],
595
603
  fuzzyResults = [],
596
- searchExp = searchTerm.toString().replace(regExp.escape, '\\$&'),
604
+ searchExp = searchTerm.replace(regExp.escape, '\\$&'),
597
605
  matchRegExp = new RegExp(regExp.beginsWith + searchExp, 'i'),
598
606
 
599
607
  // avoid duplicates when pushing results
@@ -631,22 +639,23 @@ $.fn.search = function(parameters) {
631
639
  fieldExists = (typeof content[field] == 'string')
632
640
  ;
633
641
  if(fieldExists) {
634
- if( content[field].search(matchRegExp) !== -1) {
642
+ var text = module.remove.diacritics(content[field]);
643
+ if( text.search(matchRegExp) !== -1) {
635
644
  // content starts with value (first in results)
636
645
  addResult(results, content);
637
646
  }
638
- else if(settings.fullTextSearch === 'exact' && module.exactSearch(searchTerm, content[field]) ) {
647
+ else if(settings.fullTextSearch === 'exact' && module.exactSearch(searchTerm, text) ) {
639
648
  // content fuzzy matches (last in results)
640
649
  addResult(exactResults, content);
641
650
  }
642
- else if(settings.fullTextSearch == true && module.fuzzySearch(searchTerm, content[field]) ) {
651
+ else if(settings.fullTextSearch == true && module.fuzzySearch(searchTerm, text) ) {
643
652
  // content fuzzy matches (last in results)
644
653
  addResult(fuzzyResults, content);
645
654
  }
646
655
  }
647
656
  });
648
657
  });
649
- $.merge(exactResults, fuzzyResults)
658
+ $.merge(exactResults, fuzzyResults);
650
659
  $.merge(results, exactResults);
651
660
  return results;
652
661
  }
@@ -654,10 +663,7 @@ $.fn.search = function(parameters) {
654
663
  exactSearch: function (query, term) {
655
664
  query = query.toLowerCase();
656
665
  term = term.toLowerCase();
657
- if(term.indexOf(query) > -1) {
658
- return true;
659
- }
660
- return false;
666
+ return term.indexOf(query) > -1;
661
667
  },
662
668
  fuzzySearch: function(query, term) {
663
669
  var
@@ -788,7 +794,7 @@ $.fn.search = function(parameters) {
788
794
  categoryResults[result.category] = {
789
795
  name : result.category,
790
796
  results : [result]
791
- }
797
+ };
792
798
  }
793
799
  else {
794
800
  categoryResults[result.category].results.push(result);
@@ -855,26 +861,22 @@ $.fn.search = function(parameters) {
855
861
  if(settings.type === 'category') {
856
862
  // iterate through each category result
857
863
  $.each(results, function(index, category) {
858
- resultIndex = 0;
859
- $.each(category.results, function(index, value) {
860
- var
861
- result = category.results[index]
862
- ;
863
- if(result.id === undefined) {
864
- result.id = module.create.id(resultIndex, categoryIndex);
865
- }
866
- module.inject.result(result, resultIndex, categoryIndex);
867
- resultIndex++;
868
- });
869
- categoryIndex++;
864
+ if(category.results.length > 0){
865
+ resultIndex = 0;
866
+ $.each(category.results, function(index, result) {
867
+ if(result.id === undefined) {
868
+ result.id = module.create.id(resultIndex, categoryIndex);
869
+ }
870
+ module.inject.result(result, resultIndex, categoryIndex);
871
+ resultIndex++;
872
+ });
873
+ categoryIndex++;
874
+ }
870
875
  });
871
876
  }
872
877
  else {
873
878
  // top level
874
- $.each(results, function(index, value) {
875
- var
876
- result = results[index]
877
- ;
879
+ $.each(results, function(index, result) {
878
880
  if(result.id === undefined) {
879
881
  result.id = module.create.id(resultIndex);
880
882
  }
@@ -1260,6 +1262,9 @@ $.fn.search.settings = {
1260
1262
  // search anywhere in value (set to 'exact' to require exact matches
1261
1263
  fullTextSearch : 'exact',
1262
1264
 
1265
+ // match results also if they contain diacritics of the same base character (for example searching for "a" will also match "á" or "â" or "à", etc...)
1266
+ ignoreDiacritics : false,
1267
+
1263
1268
  // whether to add events to prompt automatically
1264
1269
  automatic : true,
1265
1270
 
@@ -1317,7 +1322,8 @@ $.fn.search.settings = {
1317
1322
  oldSearchSyntax : 'searchFullText setting has been renamed fullTextSearch for consistency, please adjust your settings.',
1318
1323
  serverError : 'There was an issue querying the server.',
1319
1324
  maxResults : 'Results must be an array to use maxResults setting',
1320
- method : 'The method you called is not defined.'
1325
+ method : 'The method you called is not defined.',
1326
+ noNormalize : '"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'
1321
1327
  },
1322
1328
 
1323
1329
  metadata: {
@@ -1392,7 +1398,7 @@ $.fn.search.settings = {
1392
1398
  ;
1393
1399
  if(header) {
1394
1400
  html += ''
1395
- + '<div class="header">' + header + '</div class="header">'
1401
+ + '<div class="header">' + header + '</div>'
1396
1402
  ;
1397
1403
  }
1398
1404
  html += ' <div class="description">' + message + '</div>';
@@ -175,12 +175,10 @@ $.fn.sidebar = function(parameters) {
175
175
  bind: {
176
176
  clickaway: function() {
177
177
  module.verbose('Adding clickaway events to context', $context);
178
- if(settings.closable) {
179
- $context
180
- .on('click' + elementNamespace, module.event.clickaway)
181
- .on('touchend' + elementNamespace, module.event.clickaway)
182
- ;
183
- }
178
+ $context
179
+ .on('click' + elementNamespace, module.event.clickaway)
180
+ .on('touchend' + elementNamespace, module.event.clickaway)
181
+ ;
184
182
  },
185
183
  scrollLock: function() {
186
184
  if(settings.scrollLock) {
@@ -411,7 +409,7 @@ $.fn.sidebar = function(parameters) {
411
409
  ? callback
412
410
  : function(){}
413
411
  ;
414
- if(module.is.visible() || module.is.animating()) {
412
+ if(settings.closable && (module.is.visible() || module.is.animating())) {
415
413
  module.debug('Hiding sidebar', callback);
416
414
  module.refreshSidebars();
417
415
  module.pullPage(function() {
@@ -249,21 +249,24 @@ $.fn.transition = function() {
249
249
  visible: function() {
250
250
  var
251
251
  style = $module.attr('style'),
252
- userStyle = module.get.userStyle(),
252
+ userStyle = module.get.userStyle(style),
253
253
  displayType = module.get.displayType(),
254
254
  overrideStyle = userStyle + 'display: ' + displayType + ' !important;',
255
- currentDisplay = $module.css('display'),
256
- emptyStyle = (style === undefined || style === '')
255
+ inlineDisplay = $module[0].style.display,
256
+ mustStayHidden = !displayType || (inlineDisplay === 'none' && settings.skipInlineHidden) || $module[0].tagName.match(/(script|link|style)/i)
257
257
  ;
258
- if(currentDisplay !== displayType) {
259
- module.verbose('Overriding default display to show element', displayType);
260
- $module
261
- .attr('style', overrideStyle)
262
- ;
258
+ if (mustStayHidden){
259
+ module.remove.transition();
260
+ return false;
263
261
  }
264
- else if(emptyStyle) {
262
+ module.verbose('Overriding default display to show element', displayType);
263
+ $module
264
+ .attr('style', overrideStyle)
265
+ ;
266
+ if(style === '') {
265
267
  $module.removeAttr('style');
266
268
  }
269
+ return true;
267
270
  },
268
271
  hidden: function() {
269
272
  var
@@ -311,28 +314,27 @@ $.fn.transition = function() {
311
314
 
312
315
  set: {
313
316
  animating: function(animation) {
314
- var
315
- animationClass,
316
- direction
317
- ;
318
- // remove previous callbacks
319
- module.remove.completeCallback();
320
-
321
- // determine exact animation
322
- animation = animation || settings.animation;
323
- animationClass = module.get.animationClass(animation);
324
-
325
- // save animation class in cache to restore class names
326
- module.save.animation(animationClass);
327
-
328
317
  // override display if necessary so animation appears visibly
329
- module.force.visible();
318
+ if(module.force.visible()) {
319
+ var
320
+ animationClass,
321
+ direction
322
+ ;
323
+ // remove previous callbacks
324
+ module.remove.completeCallback();
330
325
 
331
- module.remove.hidden();
332
- module.remove.direction();
326
+ // determine exact animation
327
+ animation = animation || settings.animation;
328
+ animationClass = module.get.animationClass(animation);
329
+
330
+ // save animation class in cache to restore class names
331
+ module.save.animation(animationClass);
333
332
 
334
- module.start.animation(animationClass);
333
+ module.remove.hidden();
334
+ module.remove.direction();
335
335
 
336
+ module.start.animation(animationClass);
337
+ }
336
338
  },
337
339
  duration: function(animationName, duration) {
338
340
  duration = duration || settings.duration;
@@ -504,6 +506,7 @@ $.fn.transition = function() {
504
506
  },
505
507
  transition: function() {
506
508
  $module
509
+ .removeClass(className.transition)
507
510
  .removeClass(className.visible)
508
511
  .removeClass(className.hidden)
509
512
  ;
@@ -625,8 +628,13 @@ $.fn.transition = function() {
625
628
  return settings.displayType;
626
629
  }
627
630
  if(shouldDetermine && $module.data(metadata.displayType) === undefined) {
631
+ var currentDisplay = $module.css('display');
632
+ if(currentDisplay === '' || currentDisplay === 'none'){
628
633
  // create fake element to determine display state
629
- module.can.transition(true);
634
+ module.can.transition(true);
635
+ } else {
636
+ module.save.displayType(currentDisplay);
637
+ }
630
638
  }
631
639
  return $module.data(metadata.displayType);
632
640
  },
@@ -803,12 +811,13 @@ $.fn.transition = function() {
803
811
 
804
812
  show: function(display) {
805
813
  module.verbose('Showing element', display);
806
- module.remove.hidden();
807
- module.set.visible();
808
- module.force.visible();
809
- settings.onShow.call(element);
810
- settings.onComplete.call(element);
811
- // module.repaint();
814
+ if(module.force.visible()) {
815
+ module.remove.hidden();
816
+ module.set.visible();
817
+ settings.onShow.call(element);
818
+ settings.onComplete.call(element);
819
+ // module.repaint();
820
+ }
812
821
  },
813
822
 
814
823
  toggle: function() {
@@ -1080,6 +1089,9 @@ $.fn.transition.settings = {
1080
1089
  // new animations will occur after previous ones
1081
1090
  queue : true,
1082
1091
 
1092
+ // whether initially inline hidden objects should be skipped for transition
1093
+ skipInlineHidden: false,
1094
+
1083
1095
  metadata : {
1084
1096
  displayType: 'display'
1085
1097
  },