},
_teardown: function (options) {
// the map must be manually removed
- document.getElementById(options.target).removeChild(newdiv);
+ document.getElementById(options.target) && document.getElementById(options.target).removeChild(newdiv);
newdiv = map = location = null;
}
};
start : {elem:'input', type:'text', label:'In'},
end : {elem:'input', type:'text', label:'Out'},
target : 'news-container',
- topic : {elem:'select', type:'text', label:'Type'}
+ topic : {elem:'input', type:'text', label:'Topic'}
}
},
_setup : function( options ) {
options.container = this.container;
}
- document.getElementById( options.container.id ).appendChild( newdiv );
+ document.getElementById( options.container.id ) && document.getElementById( options.container.id ).appendChild( newdiv );
options.innerContainer = newdiv;
options.showSubtitle = function() {
},
_teardown: function( options ) {
- while ( target.firstChild ) {
+ while ( target && target.firstChild ) {
target.removeChild( target.firstChild );
}
}
// if no more word spans exist in container, remove container
container[ options.target ] &&
!container[ options.target ].childElementCount &&
- document.getElementById( options.target ).removeChild( container[ options.target ] ) &&
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( container[ options.target ] ) &&
delete container[ options.target ];
}
});