From bfbed0249ea3d3818388f8a6381a1cdbd28abe02 Mon Sep 17 00:00:00 2001 From: perploug Date: Wed, 30 Oct 2013 23:02:50 +0100 Subject: [PATCH] moves the label switch a bit up the controller --- .../views/content/content.edit.controller.js | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 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 6194c72b8c..7fd478cdc9 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 @@ -8,12 +8,24 @@ */ function ContentEditController($scope, $routeParams, $q, $timeout, $window, contentResource, navigationService, localizationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, formHelper) { + contentResource.checkPermission("P", $routeParams.id).then(function(hasPermission){ + var key = "buttons_sendToPublish" + if(hasPermission){ + key = "buttons_saveAndPublish"; + } + + localizationService.localize(key).then(function(label){ + $scope.publishButtonLabel = label; + }); + }); + + if ($routeParams.create) { //we are creating so get an empty content item contentResource.getScaffold($routeParams.id, $routeParams.doctype) .then(function(data) { $scope.loaded = true; - $scope.content = data; + $scope.content = data; }); } else { @@ -33,17 +45,6 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, cont serverValidationManager.executeAndClearAllSubscriptions(); - contentResource.checkPermission("P", $routeParams.id).then(function(hasPermission){ - var key = "buttons_sendToPublish" - if(hasPermission){ - key = "buttons_saveAndPublish"; - } - - localizationService.localize(key).then(function(label){ - $scope.publishButtonLabel = label; - }); - }); - }); }