You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
654 B

define(["jquery","core/templates","core/notification","mod_forum/repository","mod_forum/selectors","core/str"],function(a,b,c,d,e,f){var g=function(g){g.on("click",e.favourite.toggle,function(e){var g=a(this),h=g.data("forumid"),i=g.data("discussionid"),j=g.data("targetstate");d.setFavouriteDiscussionState(h,i,j).then(function(a){return b.render("mod_forum/discussion_favourite_toggle",a)}).then(function(a,c){return b.replaceNode(g,a,c)}).then(function(){return f.get_string("favouriteupdated","forum").done(function(a){return c.addNotification({message:a,type:"info"})})})["catch"](c.exception),e.preventDefault()})};return{init:function(a){g(a)}}});