From 68e84c6c591ea0864564317e6f4ed7e1438df57f Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 5 Nov 2013 10:22:31 +1100 Subject: [PATCH] Removes hard coded url --- .../views/content/content.edit.controller.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js index 0024350e0b..c45911e528 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js @@ -6,7 +6,7 @@ * @description * The controller for the content editor */ -function ContentEditController($scope, $routeParams, $q, $timeout, $window, contentResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, treeService, fileManager, formHelper) { +function ContentEditController($scope, $routeParams, $q, $timeout, $window, contentResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, treeService, fileManager, formHelper, umbRequestHelper) { $scope.defaultButton = null; $scope.subButtons = []; @@ -215,17 +215,23 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, cont } }; - $scope.options = function(content){ - if(!content.id){ + $scope.options = function (content) { + if (!content.id) { return; } - if(!$scope.actions){ - var node = {menuUrl: "/umbraco/UmbracoTrees/ContentTree/GetMenu?id=" + content.id + "&application=content"}; + if (!$scope.actions) { + var menuUrl = umbRequestHelper.getApiUrl( + "contentTreeBaseUrl", + "GetMenu", + [{ id: content.id }, { application: "content" }]); + + var node = { menuUrl: menuUrl }; + treeService.getMenu({ treeNode: node }) - .then(function(data) { - $scope.actions = data.menuItems; - }); + .then(function (data) { + $scope.actions = data.menuItems; + }); } };