mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-18 07:40:42 +00:00
Restored animations for the reveal widget
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user