Skip to content

Commit

Permalink
Merge pull request #1428 from himil-vasava/cancel_button_post
Browse files Browse the repository at this point in the history
Cancel button in post edit page
  • Loading branch information
Angamanga authored Feb 24, 2020
2 parents d377915 + 60c40a2 commit 9f3aa36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/main/posts/modify/post-data-editor.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function PostDataEditorController(
$scope.tagKeys = [];
$scope.save = $translate.instant('app.save');
$scope.saving = $translate.instant('app.saving');
$scope.cancel = cancel;
$scope.submit = $translate.instant('app.submit');
$scope.submitting = $translate.instant('app.submitting');
$scope.hasPermission = $rootScope.hasPermission('Manage Posts');
Expand Down Expand Up @@ -406,4 +407,8 @@ function PostDataEditorController(
});
});
}

function cancel() {
$state.go('posts.data.detail',{postId: $scope.post.id});
}
}
2 changes: 1 addition & 1 deletion app/main/posts/modify/post-data-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<div class="toolbar toolbar-secondary">
<div class="button-group">

<button class="button-flat" ng-click="leavePost()" translate>app.cancel</button>
<button class="button-flat" ng-click="cancel()" translate>app.cancel</button>
<button class="button button-alpha" ng-click="savePost()" ng-if="!isSaving()" translate="">app.save</button>
<loading-dots button-class="'button-alpha'" ng-if="isSaving()" disabled=true label="'app.saving'"></loading-dots>
</div>
Expand Down

0 comments on commit 9f3aa36

Please sign in to comment.