diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js
index 237a361f7e..5313eadcaa 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js
@@ -94,6 +94,13 @@ function macroResource($q, $http, umbRequestHelper) {
$http.get(umbRequestHelper.getApiUrl("macroApiBaseUrl", "GetPartialViews"),
"Failed to get partial views")
);
+ },
+
+ getParameterEditors: function () {
+ return umbRequestHelper.resourcePromise(
+ $http.get(umbRequestHelper.getApiUrl("macroApiBaseUrl", "GetParameterEditors"),
+ "Failed to get parameter editors")
+ );
}
};
}
diff --git a/src/Umbraco.Web.UI.Client/src/views/macros/infiniteeditors/parameter.html b/src/Umbraco.Web.UI.Client/src/views/macros/infiniteeditors/parameter.html
index ac01fa588e..bf9dbf86a3 100644
--- a/src/Umbraco.Web.UI.Client/src/views/macros/infiniteeditors/parameter.html
+++ b/src/Umbraco.Web.UI.Client/src/views/macros/infiniteeditors/parameter.html
@@ -26,7 +26,7 @@
-
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/macros/macros.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/macros/macros.edit.controller.js
index fa3a4e45a5..f8cde110e6 100644
--- a/src/Umbraco.Web.UI.Client/src/views/macros/macros.edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/macros/macros.edit.controller.js
@@ -71,10 +71,23 @@ function MacrosEditController($scope, $q, $routeParams, macroResource, editorSta
return deferred.promise;
}
+ function getParameterEditors() {
+ var deferred = $q.defer();
+
+ macroResource.getParameterEditors().then(function (data) {
+ deferred.resolve(data);
+ }, function () {
+ deferred.reject();
+ });
+
+ return deferred.promise;
+ }
+
function init() {
vm.page.loading = true;
vm.promises['partialViews'] = getPartialViews();
+ vm.promises['parameterEditors'] = getParameterEditors();
$q.all(vm.promises).then(function (values) {
var keys = Object.keys(values);
@@ -85,6 +98,10 @@ function MacrosEditController($scope, $q, $routeParams, macroResource, editorSta
if (keys[i] === 'partialViews') {
vm.views = values[key];
}
+
+ if (keys[i] === 'parameterEditors') {
+ vm.parameterEditors = values[key];
+ }
}
vm.page.loading = false;
@@ -130,9 +147,7 @@ function MacrosEditController($scope, $q, $routeParams, macroResource, editorSta
"editor": "Link picker"
}
]
- }
-
- vm.parameterEditors = ['editor', 'Link picker', 'Image picker'];
+ }
}
init();
diff --git a/src/Umbraco.Web/Editors/MacrosController.cs b/src/Umbraco.Web/Editors/MacrosController.cs
index 553924c3e6..6e2d032ad4 100644
--- a/src/Umbraco.Web/Editors/MacrosController.cs
+++ b/src/Umbraco.Web/Editors/MacrosController.cs
@@ -19,6 +19,7 @@ namespace Umbraco.Web.Editors
using System.Linq;
using Umbraco.Core.IO;
+ using Umbraco.Web.Composing;
///
/// The API controller used for editing dictionary items
@@ -82,6 +83,17 @@ namespace Umbraco.Web.Editors
return this.Request.CreateResponse(HttpStatusCode.OK, views);
}
+ ///
+ /// Gets the available parameter editors
+ ///
+ ///
+ /// The .
+ ///
+ public HttpResponseMessage GetParameterEditors()
+ {
+ return this.Request.CreateResponse(HttpStatusCode.OK, Current.ParameterEditors);
+ }
+
///
/// Finds all the macro partials
///