]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Fixed all plugins with issues in butter'
authorDavid Seifried <david.c.seifried@gmail.com>
Fri, 29 Jul 2011 19:32:00 +0000 (15:32 -0400)
committerDavid Seifried <david.c.seifried@gmail.com>
Fri, 29 Jul 2011 19:32:00 +0000 (15:32 -0400)
plugins/googlemap/popcorn.googlemap.js
plugins/googlenews/popcorn.googlenews.js
plugins/subtitle/popcorn.subtitle.js
plugins/timeline/popcorn.timeline.js
plugins/wordriver/popcorn.wordriver.js

index 5c044c97f3f1f3ae8bcfd687aae397a207366b8f..725bbb664d02af3174f08c63240ceeec65f4ff95 100755 (executable)
@@ -322,7 +322,7 @@ var googleCallback;
       },
       _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;
       }
     };
index 166be7d92761ba0b08045ac678895ddfae5120c0..2c294f6014fef89e98195e2e8131de1d91c43345 100755 (executable)
@@ -54,7 +54,7 @@
           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 ) {
index 4d9c718b615a188a2f86a1e0a4ee5471d3bf8f58..e801c7d4ad118f5c75bc85caa83ff23f19044b83 100755 (executable)
           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() {
index 641396b228a7a459f5a23baaa71e8c2fa0ece626..3cee6b22f2e0f0e309a0846ee193cefec77c9419 100644 (file)
@@ -89,7 +89,7 @@
       },
 
       _teardown: function( options ) {
-        while ( target.firstChild ) {
+        while ( target && target.firstChild ) {
           target.removeChild( target.firstChild );
         } 
       }
index cd74c42d490079cac8c2da535c27cf13d21817a6..173329f36ecf244454f0db88cf3a9462496241f1 100755 (executable)
         // 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 ];
       }
   });