diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index ff47aec1da..b039134ff8 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -324,6 +324,9 @@ angular.module('umbraco.services') if (!args.action) { throw "The args parameter must have an 'action' property as the clicked menu action object"; } + if (!args.node) { + throw "The args parameter must have a 'node' as the active tree node"; + } //ensure the current dialog is cleared before creating another! if (this.ui.currentDialog) { @@ -348,11 +351,7 @@ angular.module('umbraco.services') var templateUrl; var iframe; - //TODO: fix hardcoded hack for content/media... once these trees are converted over to - // new c# trees we won't need to do this any longer. - var isCreateForContent = args.action.alias === "create" && (this.ui.currentSection === "content" || this.ui.currentSection === "media"); - - if (args.action.metaData["actionUrl"] && !isCreateForContent) { + if (args.action.metaData["actionUrl"]) { templateUrl = args.action.metaData["actionUrl"]; iframe = true; } @@ -361,7 +360,12 @@ angular.module('umbraco.services') iframe = false; } else { - templateUrl = "views/" + this.ui.currentSection + "/" + args.action.alias + ".html"; + + //by convention we will look into the /views/{treetype}/{action}.html + // for example: /views/content/create.html + + templateUrl = "views/" + treeService.getTreeAlias(args.node) + "/" + args.action.alias + ".html"; + iframe = false; } diff --git a/src/Umbraco.Web.UI/App_Plugins/MyPackage/Package.manifest b/src/Umbraco.Web.UI/App_Plugins/MyPackage/Package.manifest index bdc8d9f211..84f51aa8a9 100644 --- a/src/Umbraco.Web.UI/App_Plugins/MyPackage/Package.manifest +++ b/src/Umbraco.Web.UI/App_Plugins/MyPackage/Package.manifest @@ -45,7 +45,6 @@ } ], javascript: [ - '~/App_Plugins/MyPackage/Common/Js/MyPackage.js', '~/App_Plugins/MyPackage/PropertyEditors/Js/CsvEditor.js', '~/App_Plugins/MyPackage/PropertyEditors/Js/PostcodeEditor.js', '~/App_Plugins/MyPackage/PropertyEditors/Js/RegexEditor.js' diff --git a/src/Umbraco.Web/Trees/Menu/MenuItemExtensions.cs b/src/Umbraco.Web/Trees/Menu/MenuItemExtensions.cs index 0576991eac..fadae7b1b3 100644 --- a/src/Umbraco.Web/Trees/Menu/MenuItemExtensions.cs +++ b/src/Umbraco.Web/Trees/Menu/MenuItemExtensions.cs @@ -10,12 +10,22 @@ namespace Umbraco.Web.Trees.Menu /// Used as a key for the AdditionalData to specify a specific dialog title instead of the menu title /// internal const string DialogTitleKey = "dialogTitle"; + + /// + /// Used to specify the URL that the dialog will launch to in an iframe + /// internal const string ActionUrlKey = "actionUrl"; + + internal const string ActionUrlMethodKey = "actionUrlMethod"; + + /// + /// Used to specify the angular view that the dialog will launch + /// internal const string ActionViewKey = "actionView"; /// - /// Sets the menu item to display a dialog based on a view path + /// Sets the menu item to display a dialog based on an angular view path /// /// /// @@ -27,7 +37,7 @@ namespace Umbraco.Web.Trees.Menu } /// - /// Sets the menu item to display a dialog based on a url path + /// Sets the menu item to display a dialog based on a url path in an iframe /// /// ///