weekly release 4.0dev
[moodle.git] / mod / forum / amd / build / posts_list.min.js
1 define ("mod_forum/posts_list",["jquery","core/templates","core/notification","core/pending","mod_forum/selectors","mod_forum/inpage_reply"],function(a,b,c,d,f,g){var h=function(e){e.on("click",f.post.inpageReplyLink,function(h){h.preventDefault();if(window.location.hash){var e=window.location.href.split("#")[0];history.pushState({},document.title,e)}var i=new d("inpage-reply"),j=a(h.currentTarget).parents(f.post.forumCoreContent),k=j.find(f.post.forumSubject),l=a(h.currentTarget).parents(f.post.forumContent),m={postid:a(l).data("post-id"),reply_url:a(h.currentTarget).attr("href"),sesskey:M.cfg.sesskey,parentsubject:k.data("replySubject"),canreplyprivately:a(h.currentTarget).data("can-reply-privately"),postformat:g.CONTENT_FORMATS.MOODLE};if(!l.find(f.post.inpageReplyContent).length){b.render("mod_forum/inpage_reply",m).then(function(a,c){return b.appendNodeContents(j,a,c)}).then(function(){return l.find(f.post.inpageReplyContent).slideToggle(300,i.resolve).find("textarea").focus()}).fail(c.exception)}else{var n=l.find(f.post.inpageReplyContent);n.slideToggle(300,i.resolve);if(n.is(":visible")){n.find("textarea").focus()}}})};return{init:function init(a){h(a);g.init(a)}}});
2 //# sourceMappingURL=posts_list.min.js.map