Use $location service for WP edit back URL

pull/2269/head
Hagen Schink 10 years ago
parent 112b66f6e2
commit 5529c2c333
  1. 10
      app/assets/javascripts/angular/work_packages/directives/work-package-details-toolbar-directive.js
  2. 3
      public/templates/work_packages.list.details.html

@ -34,6 +34,7 @@ angular.module('openproject.workPackages.directives')
'PERMITTED_MORE_MENU_ACTIONS',
'$state',
'$window',
'$location',
'I18n',
'HookService',
'WorkPackageService',
@ -42,6 +43,7 @@ angular.module('openproject.workPackages.directives')
function(PERMITTED_MORE_MENU_ACTIONS,
$state,
$window,
$location,
I18n,
HookService,
WorkPackageService,
@ -86,8 +88,7 @@ angular.module('openproject.workPackages.directives')
restrict: 'E',
templateUrl: '/templates/work_packages/work_package_details_toolbar.html',
scope: {
workPackage: '=',
backUrl: '='
workPackage: '='
},
link: function(scope, element, attributes) {
var authorization = new WorkPackageAuthorization(scope.workPackage);
@ -98,8 +99,11 @@ angular.module('openproject.workPackages.directives')
scope.actionsAvailable = Object.keys(scope.permittedActions).length > 0;
scope.editWorkPackage = function() {
var editWorkPackagePath = PathHelper.staticEditWorkPackagePath(scope.workPackage.props.id);
var backUrl = '?back_url=' + encodeURIComponent($location.url());
// TODO: Temporarily going to the old edit dialog until we get in-place editing done
window.location = PathHelper.staticEditWorkPackagePath(scope.workPackage.props.id) + '?back_url=' + encodeURIComponent(scope.backUrl);
window.location = editWorkPackagePath + backUrl;
};
scope.triggerMoreMenuAction = function(action, link) {

@ -55,7 +55,6 @@
</div>
<div class="bottom-toolbar">
<work-package-details-toolbar work-package='workPackage'
back-url="backUrl">
<work-package-details-toolbar work-package='workPackage'>
</work-package-details-toolbar>
</div>

Loading…
Cancel
Save