mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-26 12:14:51 +00:00
Revised test data
Testing against the output of cook.rb isn't satisfactory because of the bugs in it; instead we're now going to test against the tiddlywiki.com build products
This commit is contained in:
35
test/tiddlywiki.2.6.5/source/tiddlywiki/js/Slider.js
Executable file
35
test/tiddlywiki.2.6.5/source/tiddlywiki/js/Slider.js
Executable file
@@ -0,0 +1,35 @@
|
||||
//--
|
||||
//-- Slider animation
|
||||
//--
|
||||
|
||||
// deleteMode - "none", "all" [delete target element and it's children], [only] "children" [but not the target element]
|
||||
function Slider(element,opening,unused,deleteMode)
|
||||
{
|
||||
element.style.overflow = 'hidden';
|
||||
if(opening)
|
||||
element.style.height = '0px'; // Resolves a Firefox flashing bug
|
||||
element.style.display = 'block';
|
||||
var height = element.scrollHeight;
|
||||
var p = [];
|
||||
var c = null;
|
||||
if(opening) {
|
||||
p.push({style: 'height', start: 0, end: height, template: '%0px', atEnd: 'auto'});
|
||||
p.push({style: 'opacity', start: 0, end: 1, template: '%0'});
|
||||
p.push({style: 'filter', start: 0, end: 100, template: 'alpha(opacity:%0)'});
|
||||
} else {
|
||||
p.push({style: 'height', start: height, end: 0, template: '%0px'});
|
||||
p.push({style: 'display', atEnd: 'none'});
|
||||
p.push({style: 'opacity', start: 1, end: 0, template: '%0'});
|
||||
p.push({style: 'filter', start: 100, end: 0, template: 'alpha(opacity:%0)'});
|
||||
switch(deleteMode) {
|
||||
case "all":
|
||||
c = function(element,properties) {jQuery(element).remove();};
|
||||
break;
|
||||
case "children":
|
||||
c = function(element,properties) {jQuery(element).empty();};
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new Morpher(element,config.animDuration,p,c);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user