calendar remove event

This commit is contained in:
Yuri Kuznetsov
2014-07-09 14:52:30 +03:00
parent 0e1e481546
commit 2bfea69fe3
2 changed files with 6 additions and 2 deletions
@@ -352,6 +352,10 @@ Espo.define('Crm:Views.Calendar.Calendar', 'View', function (Dep) {
this.$calendar.fullCalendar('updateEvent', event);
}.bind(this));
},
removeModel: function (model) {
this.$calendar.fullCalendar('removeEvents', model.name + '-' + model.id);
}
});
});
@@ -84,7 +84,7 @@ Espo.define('Crm:Views.Calendar.Modals.Edit', 'Views.Modals.Edit', function (Dep
$buttons.addClass('disabled');
model.destroy({
success: function () {
this.trigger('after:remove', model);
this.trigger('after:destroy', model);
dialog.close();
}.bind(this),
error: function () {
@@ -105,7 +105,7 @@ Espo.define('Crm:Views.Calendar.Modals.Edit', 'Views.Modals.Edit', function (Dep
}
}.bind(this));
this.once('after:remove', function (model) {
this.once('after:destroy', function (model) {
var parentView = this.getParentView();
parentView.removeModel.call(parentView, model);
}.bind(this));