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