[Edit] EditorCapability continues edit on save

This commit is contained in:
Alex M 2016-09-01 23:16:31 +03:00
parent 9847c40e34
commit 90c13a3959
2 changed files with 7 additions and 7 deletions

View File

@ -81,14 +81,14 @@ define(
};
/**
* Save any changes from this editing session. This will flush all
* pending persists and end the current transaction
* Save any unsaved changes from this editing session. This will
* end the current transaction and continue with a new one.
* @returns {*}
*/
EditorCapability.prototype.save = function () {
var domainObject = this.domainObject;
return this.transactionService.commit().then(function () {
domainObject.getCapability('status').set('editing', false);
var transactionService = this.transactionService;
return transactionService.commit().then(function () {
transactionService.startTransaction();
});
};

View File

@ -134,8 +134,8 @@ define(
it("commits the transaction", function () {
expect(mockTransactionService.commit).toHaveBeenCalled();
});
it("resets the edit state", function () {
expect(mockStatusCapability.set).toHaveBeenCalledWith('editing', false);
it("begins a new transaction", function () {
expect(mockTransactionService.startTransaction).toHaveBeenCalled();
});
});