Last active
December 12, 2015 05:59
-
-
Save tkh44/4725958 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( boxId in elements.collapsedBoxes ) { | |
// TODO: This should be changed to yui3 fade,slide??? | |
//Show | |
var showAnim = new Y.Anim({ | |
node: bodyNode, | |
to: { | |
height: function(node) { | |
return node.getData('old-height'); | |
}, | |
paddingTop: '9px', | |
paddingBottom: '15px', | |
opacity: 1.0 | |
}, | |
easing: 'easeOut', | |
duration: 0.5 | |
}); | |
//Calculate the proper height to expand to before the animation begins | |
// "start" event is too late so must be done on "init" | |
showAnim.on('init', function(e) { | |
var node = showAnim.get('node'); | |
node.removeClass('hide'); | |
node.setStyle('height', 'auto'); | |
node.setData('old-height', node.getComputedStyle('height')); | |
node.setStyle('height', '0'); | |
}); | |
showAnim.on('end', function(e) { | |
showAnim.get('node').setStyle('height', 'auto'); | |
}); | |
showAnim.run(); | |
delete elements.rollingBoxes[boxId]; | |
delete elements.collapsedBoxes[boxId]; | |
} | |
else { | |
// HIDE | |
var hideAnim = new Y.Anim({ | |
node: bodyNode, | |
to: { | |
height: 0, | |
paddingTop: 0, | |
paddingBottom: 0, | |
opacity: 0.0 | |
}, | |
easing: 'easeOut', | |
duration: 0.5 | |
}); | |
hideAnim.run(); | |
delete elements.rollingBoxes[boxId]; | |
elements.collapsedBoxes[boxId] = true; | |
} | |
if (!no_nvdata) setBoxStatus(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment