Fixes: U4-5801 macro container property needs to be type TEXT

This commit is contained in:
Shannon
2014-11-13 18:06:58 +11:00
parent 6df6e3bdad
commit ccd438ba26
3 changed files with 16 additions and 13 deletions

View File

@@ -66,20 +66,23 @@ angular.module('umbraco')
openDialog(index);
};
$scope.add =function(){
openDialog();
$scope.add = function () {
if ($scope.model.config.max && $scope.model.config.max > 0 && $scope.renderModel.length >= $scope.model.config.max) {
//cannot add more than the max
return;
}
openDialog();
};
$scope.remove =function(index){
$scope.renderModel.splice(index, 1);
$scope.macros.splice(index, 1);
$scope.model.value = trim($scope.macros.join(), ",");
};
$scope.clear = function() {
$scope.model.value = "";
$scope.renderModel = [];
$scope.macros = [];
};
$scope.$on("formSubmitting", function (ev, args) {

View File

@@ -17,12 +17,12 @@
</li>
</ul>
<ul class="unstyled list-icons">
<li>
<ul class="unstyled list-icons" ng-hide="model.config.max && model.config.max > 0 && renderModel.length >= model.config.max">
<li>
<i class="icon icon-add blue"></i>
<a href="#" ng-click="add()" prevent-default>
<localize key="general_add">Add</localize>
</a>
</li>
</ul>
<a href="#" ng-click="add()" prevent-default>
<localize key="general_add">Add</localize>
</a>
</li>
</ul>
</div>

View File

@@ -9,7 +9,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
[PropertyEditor(Constants.PropertyEditors.MacroContainerAlias, "Macro container", "macrocontainer")]
[PropertyEditor(Constants.PropertyEditors.MacroContainerAlias, "Macro container", "macrocontainer", ValueType = "TEXT")]
public class MacroContainerPropertyEditor : PropertyEditor
{
/// <summary>