// Default to up if options.direction is non-existant or not up or down
options.direction = options.direction || "up";
- if ( options.direction.toLowerCase() !== "up" || options.direction.toLowerCase() !== "down" ) {
- options.direction = "up";
- }
+ if ( options.direction.toLowerCase() === "down" ) {
- if ( target ) {
-
- target.style.width = "400px";
- target.style.height = "200px";
- target.style.overflow = "auto";
- target.appendChild( newdiv );
+ goingUp = false;
+ }
+ if ( target && container ) {
// if this isnt the first div added to the target div
- if( options.direction.length === 2 ){
+ if( goingUp ){
// insert the current div before the previous div inserted
- target.insertBefore( newdiv, document.getElementById( "timelineDiv" + ( i - 1 ) ) );
+ container.insertBefore( contentDiv, container.firstChild );
+ }
+ else {
+
+ container.appendChild( contentDiv );
}
+ } else if ( Popcorn.plugin.debug ) {
+ throw new Error( "target container doesn't exist" );
}
i++;