From: ScottDowne Date: Mon, 10 Jan 2011 21:09:46 +0000 (-0500) Subject: [#249] moved code block into closure X-Git-Tag: v0.2~7^2~1^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=a131fcceab7cd0dbab20d8f5f45131b05e5c21ce;p=popcorn-js.git [#249] moved code block into closure --- diff --git a/plugins/twitter/popcorn.twitter.js b/plugins/twitter/popcorn.twitter.js index a5b88b2..0ebba93 100644 --- a/plugins/twitter/popcorn.twitter.js +++ b/plugins/twitter/popcorn.twitter.js @@ -1,14 +1,5 @@ // PLUGIN: TWITTER -if ( !window.TWTR ) { - var head = document.getElementsByTagName("head")[0] || document.documentElement, - script = document.createElement("script"); - - script.src = "http://widgets.twimg.com/j/2/widget.js"; - - head.insertBefore( script, head.firstChild ); -} - (function (Popcorn) { /** @@ -38,6 +29,16 @@ if ( !window.TWTR ) { } ) * */ + + if ( !window.TWTR ) { + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.src = "http://widgets.twimg.com/j/2/widget.js"; + + head.insertBefore( script, head.firstChild ); + } + Popcorn.plugin( "twitter" , { manifest: {