moschino-ccss16
Version:
Moschino's Capsule Collection Spring Summer 2016 package
58 lines (44 loc) • 1.56 kB
JavaScript
var LiveSocialView = {
$el : null,
postanoEmbed : null,
postanoScriptUrl : 'http://embed3.postano.com/prod/build/js/69596/10694/embed.js',
initialize : function() {
this.$el = $('.body section');
this.$el.addClass('show');
this.initPostano();
},
initPostano : function() {
var _this = this;
(function(id) {
var js = document.createElement('script');
js.id = id;
js.src = _this.postanoScriptUrl;
document.body.appendChild(js);
js.onload = function() {
_this.postanoEmbed = PostanoEmbed.get('69596-10694');
//Widget Created
_this.postanoEmbed.on(Postano.Events.widgetCreated, function(data) {
// FORCE SOCIAL LINK TO OPEN IN _BLANK WINDOW
_this.$el.find('.pwe_posts').on('click tap', '.pwe_post', function(event) {
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
var _id = $(e.currentTarget).data('post-id');
_gaq.push(['_trackEvent', 'CustomTemplateEvents', 'MISSONMOSCHINO_CC_SS16I_streaminglive', 'live_postano_viewPost_' + _id]);
// If we are on smartphone
if (Postano.Env.smartphone) {
window.stop();
$(event.currentTarget).find('.pwe_post_meta_container a.pwe_post_action:eq(0)').trigger('click');
}
return false;
});
});
};
}('postano-embed-loader-69596-10694'));
},
unbindEvents : function() {
this.postanoEmbed = null;
this.$el.find('.pwe_posts').off('click tap');
$('#postano-embed-loader-69596-10694').remove();
}
};