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
891 B

define(["jquery","core/ajax","core/notification"],function(a,b,c){var d=function(b){this.root=a(b),this.userId=this.root.attr("data-user-id"),this.name=this.root.attr("data-processor-name"),this.root.find("form").on("submit",function(c){c.preventDefault(),this.save().done(function(){a(b).trigger("mpp:formsubmitted")})}.bind(this))};return d.prototype.startLoading=function(){this.root.addClass("loading")},d.prototype.stopLoading=function(){this.root.removeClass("loading")},d.prototype.isLoading=function(){return this.root.hasClass("loading")},d.prototype.save=function(){if(this.isLoading())return a.Deferred();this.startLoading();var d=this.root.find("form").serializeArray(),e={methodname:"core_message_message_processor_config_form",args:{userid:this.userId,name:this.name,formvalues:d}};return b.call([e])[0].fail(c.exception).always(function(){this.stopLoading()}.bind(this))},d});