Browse Source

WIP transition fixes for detection

pull/1378/head
jlukic 10 years ago
parent
commit
53584d83be
2 changed files with 22 additions and 21 deletions
  1. 3
      src/definitions/modules/dropdown.js
  2. 40
      src/definitions/modules/transition.js

3
src/definitions/modules/dropdown.js

@ -1108,6 +1108,9 @@ $.fn.dropdown = function(parameters) {
hide: function(callback, $subMenu) {
var
$currentMenu = $subMenu || $menu,
duration = ($subMenu)
? (settings.duration * 0.9)
: settings.duration,
start = ($subMenu)
? function() {}
: function() {

40
src/definitions/modules/transition.js

@ -145,7 +145,7 @@ $.fn.transition = function() {
}
}
if(module.can.animate()) {
if( module.can.animate() ) {
module.set.animating(settings.animation);
}
else {
@ -499,29 +499,21 @@ $.fn.transition = function() {
},
can: {
animate: function() {
if($module.css(settings.animation) !== 'none') {
module.debug('CSS definition found', $module.css(settings.animation));
return true;
}
else {
module.debug('Unable to find css definition', $module.attr('class'));
return false;
}
},
transition: function(forced) {
var
elementClass = $module.attr('class'),
tagName = $module.prop('tagName'),
animation = settings.animation,
transitionExists = module.get.transitionExists(settings.animation),
transitionExists = module.get.transitionExists(animation),
$clone,
currentAnimation,
inAnimation,
animationExists,
directionExists,
displayType
;
if( transitionExists === undefined || forced) {
console.log($.fn.transition.exists);
console.log(transitionExists, forced);
module.verbose('Determining whether animation exists');
$clone = $('<' + tagName + ' />').addClass( elementClass ).insertAfter($module);
currentAnimation = $clone
@ -545,21 +537,27 @@ $.fn.transition = function() {
.css('display')
;
module.verbose('Determining final display state', displayType);
$clone.remove();
if(currentAnimation != inAnimation) {
module.debug('Transition exists for animation', animation);
animationExists = true;
module.debug('Direction exists for animation', animation);
directionExists = true;
}
else if(currentAnimation == 'none' || !currentAnimation) {
module.debug('No animation defined in css', animation);
return;
}
else {
module.debug('Static animation found', animation, displayType);
animationExists = false;
directionExists = false;
}
$clone.remove();
module.save.displayType(displayType);
if(transitionExists === undefined) {
module.save.transitionExists(animation, animationExists);
}
module.save.transitionExists(animation, directionExists);
}
return transitionExists || animationExists;
return transitionExists || directionExists;
},
animate: function() {
// can transition does not return a value if animation does not exist
return (module.can.transition() !== undefined);
}
},

Loading…
Cancel
Save