js/src/fields/FieldControlModelModal.js
//KB.Backbone.Common.FieldControlModelModal
var FieldControlModel = require('./FieldControlModel');
module.exports = FieldControlModel.extend({
bindHandlers: function () {
this.listenToOnce(this.ModuleModel, 'remove', this.remove);
this.listenTo(this.ModuleModel, 'change:entityData', this.setData);
this.listenTo(KB.Events, 'modal.reload', this.rebind);
this.listenTo(KB.Events, 'modal.close', this.remove);
},
rebind: function () {
if (this.FieldControlView) {
this.FieldControlView.setElement(this.getElement());
this.FieldControlView.rerender();
}
},
getElement: function () {
return jQuery('*[data-kbfuid="' + this.get('uid') + '"]');
}
});