Skip to content

Commit ccd438b

Browse files
committed
Fixes: U4-5801 macro container property needs to be type TEXT
1 parent 6df6e3b commit ccd438b

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

src/Umbraco.Web.UI.Client/src/views/propertyeditors/macrocontainer/macrocontainer.controller.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,23 @@ angular.module('umbraco')
6666
openDialog(index);
6767
};
6868

69-
$scope.add =function(){
70-
openDialog();
69+
$scope.add = function () {
70+
71+
if ($scope.model.config.max && $scope.model.config.max > 0 && $scope.renderModel.length >= $scope.model.config.max) {
72+
//cannot add more than the max
73+
return;
74+
}
75+
76+
openDialog();
7177
};
7278

7379
$scope.remove =function(index){
7480
$scope.renderModel.splice(index, 1);
75-
$scope.macros.splice(index, 1);
76-
$scope.model.value = trim($scope.macros.join(), ",");
7781
};
7882

7983
$scope.clear = function() {
8084
$scope.model.value = "";
8185
$scope.renderModel = [];
82-
$scope.macros = [];
8386
};
8487

8588
$scope.$on("formSubmitting", function (ev, args) {

src/Umbraco.Web.UI.Client/src/views/propertyeditors/macrocontainer/macrocontainer.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
</li>
1818
</ul>
1919

20-
<ul class="unstyled list-icons">
21-
<li>
20+
<ul class="unstyled list-icons" ng-hide="model.config.max && model.config.max > 0 && renderModel.length >= model.config.max">
21+
<li>
2222
<i class="icon icon-add blue"></i>
23-
<a href="#" ng-click="add()" prevent-default>
24-
<localize key="general_add">Add</localize>
25-
</a>
26-
</li>
27-
</ul>
23+
<a href="#" ng-click="add()" prevent-default>
24+
<localize key="general_add">Add</localize>
25+
</a>
26+
</li>
27+
</ul>
2828
</div>

src/Umbraco.Web/PropertyEditors/MacroContainerPropertyEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace Umbraco.Web.PropertyEditors
1111
{
12-
[PropertyEditor(Constants.PropertyEditors.MacroContainerAlias, "Macro container", "macrocontainer")]
12+
[PropertyEditor(Constants.PropertyEditors.MacroContainerAlias, "Macro container", "macrocontainer", ValueType = "TEXT")]
1313
public class MacroContainerPropertyEditor : PropertyEditor
1414
{
1515
/// <summary>

0 commit comments

Comments
 (0)