var __assign=function(){return(__assign=Object.assign||function(e){for(var t,o=1,i=arguments.length;o

Leave a comment.

',commentPluginStrings:{toggleComments:"Toggle Comments"}},CommentBox=function(){function e(e,t){return this.core=e,this.$LG=t,this.settings=__assign(__assign({},commentSettings),this.core.settings),this}return e.prototype.init=function(){this.settings.commentBox&&(this.setMarkup(),this.toggleCommentBox(),this.settings.fbComments?this.addFbComments():this.settings.disqusComments&&this.addDisqusComments())},e.prototype.setMarkup=function(){this.core.outer.append(this.settings.commentsMarkup+'
');var e='';this.core.$toolbar.append(e)},e.prototype.toggleCommentBox=function(){var e=this;this.core.outer.find(".lg-comment-toggle").first().on("click.lg.comment",function(){e.core.outer.toggleClass("lg-comment-active")}),this.core.outer.find(".lg-comment-overlay").first().on("click.lg.comment",function(){e.core.outer.removeClass("lg-comment-active")}),this.core.outer.find(".lg-comment-close").first().on("click.lg.comment",function(){e.core.outer.removeClass("lg-comment-active")})},e.prototype.addFbComments=function(){var t=this,o=this;this.core.LGel.on(lGEvents.beforeSlide+".comment",function(e){e=t.core.galleryItems[e.detail.index].fbHtml;t.core.outer.find(".lg-comment-body").html(e)}),this.core.LGel.on(lGEvents.afterSlide+".comment",function(){try{FB.XFBML.parse()}catch(e){o.$LG(window).on("fbAsyncInit",function(){FB.XFBML.parse()})}})},e.prototype.addDisqusComments=function(){var i=this,e=this.$LG("#disqus_thread");e.remove(),this.core.outer.find(".lg-comment-body").append('
'),this.core.LGel.on(lGEvents.beforeSlide+".comment",function(){e.html("")}),this.core.LGel.on(lGEvents.afterSlide+".comment",function(e){var t=e.detail.index,o=i;setTimeout(function(){try{DISQUS.reset({reload:!0,config:function(){this.page.identifier=o.core.galleryItems[t].disqusIdentifier,this.page.url=o.core.galleryItems[t].disqusURL,this.page.title=o.settings.disqusConfig.title,this.language=o.settings.disqusConfig.language}})}catch(e){console.error("Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/")}},o.core.lGalleryOn?0:1e3)})},e.prototype.destroy=function(){this.core.LGel.off(".lg.comment"),this.core.LGel.off(".comment")},e}();export default CommentBox;