]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Created some variables to store a refence to a DOM object that was being called numer...
authorDavid Seifried <david.c.seifried@gmail.com>
Fri, 26 Aug 2011 18:47:31 +0000 (14:47 -0400)
committerDavid Seifried <david.c.seifried@gmail.com>
Fri, 26 Aug 2011 18:47:31 +0000 (14:47 -0400)
plugins/googlemap/popcorn.googlemap.js
plugins/wordriver/popcorn.wordriver.js

index 725bbb664d02af3174f08c63240ceeec65f4ff95..a97901c9553318df988221beb1ba26a8e777784b 100755 (executable)
@@ -321,8 +321,11 @@ var googleCallback;
         }
       },
       _teardown: function (options) {
+
+        var target = document.getElementById(options.target);
+
         // the map must be manually removed
-        document.getElementById(options.target) && document.getElementById(options.target).removeChild(newdiv);
+        target && target.removeChild(newdiv);
         newdiv = map = location = null;
       }
     };
index 173329f36ecf244454f0db88cf3a9462496241f1..e727c735d031951b7fbce7998b0f8aed815ccf0e 100755 (executable)
       },
       _teardown: function( options ) {
 
+        var target = document.getElementById( options.target );
         // removes word span from generated container
         options.word.parentNode && options._container.removeChild( options.word );
 
         // if no more word spans exist in container, remove container
         container[ options.target ] &&
           !container[ options.target ].childElementCount &&
-          document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( container[ options.target ] ) &&
+          target && target.removeChild( container[ options.target ] ) &&
           delete container[ options.target ];
       }
   });