From 8d41d921f0911ed1a901c9adb6cd8e940ededf9b Mon Sep 17 00:00:00 2001 From: himil-vasava Date: Tue, 11 Feb 2020 14:38:37 +0530 Subject: [PATCH 1/2] Cancel button in post edit page --- app/main/posts/modify/post-data-editor.directive.js | 4 ++++ app/main/posts/modify/post-data-editor.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/main/posts/modify/post-data-editor.directive.js b/app/main/posts/modify/post-data-editor.directive.js index d8e16243e0..b0ebc3f8d9 100644 --- a/app/main/posts/modify/post-data-editor.directive.js +++ b/app/main/posts/modify/post-data-editor.directive.js @@ -89,6 +89,10 @@ function PostDataEditorController( $scope.selectForm = selectForm; $scope.isSaving = LoadingProgress.getSavingState; + $scope.cancel = function () { + $location.path('/views/data'); + }; + var ignoreCancelEvent = false; // Need state management $scope.$on('event:edit:post:reactivate', function () { diff --git a/app/main/posts/modify/post-data-editor.html b/app/main/posts/modify/post-data-editor.html index 45729ad525..9ad55a77b8 100644 --- a/app/main/posts/modify/post-data-editor.html +++ b/app/main/posts/modify/post-data-editor.html @@ -69,7 +69,7 @@
- +
From 2dd466d9104db2bb7554925e1a22aafce9e74146 Mon Sep 17 00:00:00 2001 From: Himil Vasava <55590415+himil-vasava@users.noreply.github.com> Date: Thu, 13 Feb 2020 01:42:02 +0530 Subject: [PATCH 2/2] Working of cancel button in post edit page --- app/main/posts/modify/post-data-editor.directive.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/main/posts/modify/post-data-editor.directive.js b/app/main/posts/modify/post-data-editor.directive.js index b0ebc3f8d9..975f9ddb9a 100644 --- a/app/main/posts/modify/post-data-editor.directive.js +++ b/app/main/posts/modify/post-data-editor.directive.js @@ -83,16 +83,13 @@ 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'); $scope.selectForm = selectForm; $scope.isSaving = LoadingProgress.getSavingState; - $scope.cancel = function () { - $location.path('/views/data'); - }; - var ignoreCancelEvent = false; // Need state management $scope.$on('event:edit:post:reactivate', function () { @@ -410,4 +407,8 @@ function PostDataEditorController( }); }); } + + function cancel() { + $state.go('posts.data.detail',{postId: $scope.post.id}); + } }