I'm trying to get the like box to work inside our ember app, in a template called about. The problem is that if I enter the ember app from another route (instead of about route), then navigate to the about route with link-to helpers, then the like box is not rendered. Instead, if I enter/refresh the about route directly, it renders just fine. Any ideas on how to make it render even if somebody navigates to that route from another route ?
templates/about.hbs:
...
<div class = "fb-like-box" data-href = "http://ift.tt/1Cisg3t" data-width = "250"
data-height = "313" data-colorscheme = "light" data-show-faces = "true" data-header = "false"
data-stream = "false" data-show-border = "true"></div>
...
views/application.js:
export default Ember.View.extend({
facebook_app_id: config.APP.facebook_app_id,
initLibs: function ()
{
// initialize Facebook SDK
var facebook_id = this.facebook_app_id;
window.fbAsyncInit = function ()
{
FB.init({
appId: facebook_id,
xfbml: true,
version: 'v2.1'
});
};
(function (d, s, id)
{
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id))
{
return;
}
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}.on('didInsertElement')
});
Aucun commentaire:
Enregistrer un commentaire