Restored animations for the reveal widget

This commit is contained in:
Jeremy Ruston
2013-11-01 17:23:08 +00:00
parent 0b0fb0a145
commit 6a6f6c7713
4 changed files with 53 additions and 6 deletions
+4 -2
View File
@@ -13,7 +13,8 @@ A simple slide animation that varies the height of the element
"use strict";
function slideOpen(domNode,options) {
var duration = $tw.utils.getAnimationDuration();
options = options || {};
var duration = options.duration || $tw.utils.getAnimationDuration();
// Get the current height of the domNode
var computedStyle = window.getComputedStyle(domNode),
currMarginBottom = parseInt(computedStyle.marginBottom,10),
@@ -65,7 +66,8 @@ function slideOpen(domNode,options) {
}
function slideClosed(domNode,options) {
var duration = $tw.utils.getAnimationDuration(),
options = options || {};
var duration = options.duration || $tw.utils.getAnimationDuration(),
currHeight = domNode.offsetHeight;
// Clear the properties we've set when the animation is over
setTimeout(function() {
+9
View File
@@ -47,6 +47,15 @@ TW_Element.prototype.setAttributeNS = function(namespace,name,value) {
this.setAttribute(name,value);
};
TW_Element.prototype.removeAttribute = function(name) {
if(this.isRaw) {
throw "Cannot removeAttribute on a raw TW_Element";
}
if($tw.utils.hop(this.attributes,name)) {
delete this.attributes[name];
}
};
TW_Element.prototype.appendChild = function(node) {
this.children.push(node);
node.parentNode = this;