diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.controller.js index d8cc93c1b8..36d7c0f4ed 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.controller.js @@ -1,35 +1,47 @@ (function () { "use strict"; - function TemplateSectionsOverlayController($scope) { + function TemplateSectionsController($scope, formHelper) { var vm = this; + vm.select = select; + vm.submit = submit; + vm.close = close; + $scope.model.mandatoryRenderSection = false; if(!$scope.model.title) { $scope.model.title = "Sections"; } - vm.select = select; - function onInit() { - if($scope.model.hasMaster) { $scope.model.insertType = 'addSection'; } else { $scope.model.insertType = 'renderBody'; } - } function select(type) { $scope.model.insertType = type; } + function submit(model) { + if (formHelper.submitForm({scope: $scope})) { + $scope.model.submit($scope.model); + } + } + + function close() { + if($scope.model.close) { + $scope.model.close(); + } + } + onInit(); } - angular.module("umbraco").controller("Umbraco.Overlays.TemplateSectionsOverlay", TemplateSectionsOverlayController); + angular.module("umbraco").controller("Umbraco.Editors.TemplateSectionsController", TemplateSectionsController); })(); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.html index b97057302e..d6e3996287 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/templatesections/templatesections.html @@ -1,64 +1,105 @@ -