Last active
August 29, 2015 14:07
-
-
Save aortbals/536c57f4b97d4c01a853 to your computer and use it in GitHub Desktop.
Ember Twitter Sharing Button Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import config from 'app/config/environment'; | |
export default { | |
name: 'twitter', | |
initialize: function(container, application) { | |
Ember.debug('Initializing twitter widgets') | |
window.twttr = (function (d, s, id) { | |
var t, js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.src = "https://platform.twitter.com/widgets.js"; | |
fjs.parentNode.insertBefore(js, fjs); | |
return window.twttr || (t = { _e: [], ready: function (f) { t._e.push(f) } }); | |
}(document, "script", "twitter-wjs")); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment