window formComponentData flight component function this submitLoginFor

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
window.formComponentData = flight.component(function() {
this.submitLoginForm = function(e) {
e.preventDefault();
this.trigger('submit-form');
var submitUrl = this.$node.attr('action');
var that = this;
$.post(submitUrl, this.$node.serialize())
.done(function(response){
if (response.status == 'SUCCESS') {
that.trigger('submit-done', response.result);
} else {
that.trigger('submit-error',response.result);
}
});
};
this.after('initialize', function() {
this.on('submit', this.submitLoginForm)
});
});