We were refering to the wrong 'name' variable during cleaning up the

backform controls.
This commit is contained in:
Ashesh Vashi 2018-08-08 11:53:48 +05:30
parent 7b2c1bb9f8
commit ffd41009ea

View File

@ -112,9 +112,15 @@ define([
// Remove the events for the dependent fields in the model
var self = this,
deps = self.field.get('deps');
var attrArr = this.field.get('name').split('.');
var name = attrArr.shift();
self.stopListening(self.model, 'change:' + name, self.render);
self.stopListening(self.model.errorModel, 'change:' + name, self.updateInvalid);
if (self.model.errorModel instanceof Backbone.Model) {
self.stopListening(
self.model.errorModel, 'change:' + name, self.updateInvalid
);
}
if (deps && _.isArray(deps)) {
_.each(deps, function(d) {