From f8ed2a3db4e4d63878084f4c756f75a3f3be4dfc Mon Sep 17 00:00:00 2001 From: Lars-Erik Aabech Date: Sun, 4 Jun 2017 18:03:07 +0200 Subject: [PATCH] Blueprint dialogs done(ish) --- .../src/views/content/content.create.controller.js | 12 ++++-------- .../content/content.createblueprint.controller.js | 13 ++++--------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js index 0ae6cb01cc..aacdec9058 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js @@ -6,7 +6,7 @@ * @description * The controller for the content creation dialog */ -function contentCreateController($scope, $routeParams, contentTypeResource, iconHelper, $location) { +function contentCreateController($scope, $routeParams, contentTypeResource, iconHelper, $location, navigationService) { contentTypeResource.getAllowedTypes($scope.currentNode.id).then(function (data) { $scope.allowedTypes = iconHelper.formatContentTypeIcons(data); }); @@ -15,11 +15,7 @@ function contentCreateController($scope, $routeParams, contentTypeResource, icon $scope.selectBlueprint = false; $scope.createOrSelectBlueprintIfAny = function (docType) { - docType.blueprints = - { - "1": "A blue print", - "2": "A red print" - }; + // TODO: The none one if (docType.blueprints && _.keys(docType.blueprints).length) { $scope.docType = docType; @@ -29,7 +25,7 @@ function contentCreateController($scope, $routeParams, contentTypeResource, icon $location .path("/content/content/edit/" + $scope.currentNode.id) .search("doctype=" + docType.alias + "&create=true"); - $scope.close(); + navigationService.hideMenu(); } } @@ -41,7 +37,7 @@ function contentCreateController($scope, $routeParams, contentTypeResource, icon "&create=true" + "&blueprintId=" + blueprintId ); - $scope.close(); + navigationService.hideMenu(); } } diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js index 77c5ab6e3f..18294a98d4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js @@ -3,7 +3,8 @@ function CreateBlueprintController( $scope, contentResource, - notificationService + notificationService, + navigationService ) { $scope.name = $scope.currentNode.name; @@ -16,17 +17,11 @@ header: "Created blueprint", message: "Blueprint was created based on " + $scope.name }); - $scope.close(); + navigationService.hideMenu(); }); }; } - angular.module("umbraco").controller("Umbraco.Editors.Content.CreateBlueprintController", - [ - "$scope", - "contentResource", - "notificationsService", - CreateBlueprintController - ]); + angular.module("umbraco").controller("Umbraco.Editors.Content.CreateBlueprintController", CreateBlueprintController); }()); \ No newline at end of file