Skip to content

Commit

Permalink
Merge pull request #4698 from adube/793-fix-edit-modal
Browse files Browse the repository at this point in the history
793 - Fix GMF edit feature stop editing while dirty
  • Loading branch information
adube committed Feb 28, 2019
2 parents a5f196f + 05e5908 commit e4045ad
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions contribs/gmf/src/editing/editFeatureComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,13 +603,27 @@ Controller.prototype.$onInit = function() {
(newValue, oldValue) => {
const state = EditingState;
if (newValue === state.STOP_EDITING_PENDING) {
this.confirmCancel().then(() => {
if (this.feature && this.dirty) {
this.confirmCancel().then(() => {
this.timeout_(() => {
this.state = state.STOP_EDITING_EXECUTE;
this.scope_.$apply();
}, 500);
});
} else {
this.state = state.STOP_EDITING_EXECUTE;
});
}
} else if (newValue === state.DEACTIVATE_PENDING) {
this.confirmCancel().then(() => {
if (this.feature && this.dirty) {
this.confirmCancel().then(() => {
this.timeout_(() => {
this.state = state.DEACTIVATE_EXECUTE;
this.scope_.$apply();
}, 500);
});
} else {
this.state = state.DEACTIVATE_EXECUTE;
});
}
}
}
);
Expand Down

0 comments on commit e4045ad

Please sign in to comment.