[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 * Save any unsaved changes from this editing session. This will
* pending persists and end the current transaction * end the current transaction and continue with a new one.
* @returns {*} * @returns {*}
*/ */
EditorCapability.prototype.save = function () { EditorCapability.prototype.save = function () {
var domainObject = this.domainObject; var transactionService = this.transactionService;
return this.transactionService.commit().then(function () { return transactionService.commit().then(function () {
domainObject.getCapability('status').set('editing', false); transactionService.startTransaction();
}); });
}; };

View File

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