Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel button in post edit page #1428

Merged
merged 5 commits into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job finding your way to this!

<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