Merge pull request #1347 from nasa/open1278

[Edit Mode] Fix issue with navigation not triggering unsaved changes warning
This commit is contained in:
Victor Woeltjen 2016-12-06 13:50:53 -08:00 committed by GitHub
commit bf006b45e4

View File

@ -40,19 +40,17 @@ define([], function () {
var wasActive = transactionService.isActive();
cacheService.put(domainObject.getId(), domainObject.getModel());
if (persistence.persisted()) {
if (!wasActive) {
transactionService.startTransaction();
}
if (!wasActive) {
transactionService.startTransaction();
}
transactionService.addToTransaction(
persistence.persist.bind(persistence),
persistence.refresh.bind(persistence)
);
transactionService.addToTransaction(
persistence.persist.bind(persistence),
persistence.refresh.bind(persistence)
);
if (!wasActive) {
transactionService.commit();
}
if (!wasActive) {
transactionService.commit();
}
});
}