]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
More trying to fix tests
authorMatthew Schranz <schranz.m@gmail.com>
Wed, 28 Sep 2011 21:02:14 +0000 (17:02 -0400)
committerMatthew Schranz <schranz.m@gmail.com>
Wed, 28 Sep 2011 21:02:14 +0000 (17:02 -0400)
plugins/facebook/popcorn.facebook.js

index 55256ce45ba3ce343ffcf54980dcca6242768c4a..0ae26b97d46cb18fc23b1771444113d784a9d3f6 100755 (executable)
       }
 
 
-      options.container = document.createElement( "div" );
-      options.container.id = "facebookdiv-" + Popcorn.guid();
-      facebookdiv = document.createElement( "fb:" + _type );
-      options.container.appendChild( facebookdiv );
+      options._container = document.createElement( "div" );
+      options._container.id = "facebookdiv-" + Popcorn.guid();
+      options._facebookdiv = document.createElement( "fb:" + _type );
+      options._container.appendChild( options._facebookdiv );
 
       // All the the "types" for facebook share largely identical attributes, for loop suffices.
       // ** Credit to Rick Waldron, it's essentially all his code in this function.
       // activity feed uses 'site' rather than 'href'
       var attr = _type === "activity" ? "site" : "href";
 
-      facebookdiv.setAttribute( attr, ( options[ attr ] || document.URL ) );
+      options._facebookdiv.setAttribute( attr, ( options[ attr ] || document.URL ) );
 
       // create an array of Facebook widget attributes
       var fbAttrs = (
       Popcorn.forEach( fbAttrs, function( attr ) {
         // Test for null/undef. Allows 0, false & ""
         if ( options[ attr ] != null ) {
-          facebookdiv.setAttribute( attr, options[ attr ] );
+          options._facebookdiv.setAttribute( attr, options[ attr ] );
         }
       });
 
       if ( !target && Popcorn.plugin.debug ) {
         throw new Error( "Facebook target container doesn't exist" );
       }
-      target && target.appendChild( options.container );
+      target && target.appendChild( options._container );
     },
     /**
     * @member facebook
     * options variable
     */
     start: function( event, options ){
-      options.container.style.display = "";
+      options._container.style.display = "";
     },
     /**
     * @member facebook
     * options variable
     */
     end: function( event, options ){
-      options.container.style.display = "none";
+      options._container.style.display = "none";
     },
-    _teardown: function( event, options ){
-      target && target.removeChild( facebookdiv );
+    _teardown: function( options ){
+      var target = document.getElementById( options.target );
+      target && target.removeChild( options._facebookdiv );
     }
   });