added submit button for row and layoutconfig (#5136)

This commit is contained in:
Dennis Flæng
2019-04-23 20:17:38 +02:00
committed by Sebastiaan Janssen
parent 977bf91409
commit 7eadcf66ed
5 changed files with 41 additions and 9 deletions
@@ -79,6 +79,12 @@ angular.module("umbraco")
}
}
$scope.submit = function () {
if ($scope.model.submit) {
$scope.model.submit($scope.currentLayout);
}
}
$scope.$watch("currentLayout", function(layout){
if(layout){
var total = 0;
@@ -150,6 +150,12 @@
shortcut="esc"
action="close()">
</umb-button>
<umb-button
type="button"
button-style="success"
label-key="general_submit"
action="submit()">
</umb-button>
</umb-editor-footer-content-right>
</umb-editor-footer>
@@ -90,6 +90,12 @@ function RowConfigController($scope, localizationService) {
}
}
$scope.submit = function () {
if ($scope.model.submit) {
$scope.model.submit($scope.currentRow);
}
}
$scope.nameChanged = false;
var originalName = $scope.currentRow.name;
$scope.$watch("currentRow", function(row) {
@@ -135,6 +135,12 @@
shortcut="esc"
action="close()">
</umb-button>
<umb-button
type="button"
button-style="success"
label-key="general_submit"
action="submit()">
</umb-button>
</umb-editor-footer-content-right>
</umb-editor-footer>
@@ -78,7 +78,7 @@ angular.module("umbraco")
$scope.configureTemplate = function(template) {
var templatesCopy = angular.copy($scope.model.value.templates);
var index = $scope.model.value.templates.indexOf(template);
if (template === undefined) {
template = {
@@ -87,16 +87,20 @@ angular.module("umbraco")
]
};
$scope.model.value.templates.push(template);
}
var layoutConfigOverlay = {
currentLayout: template,
currentLayout: angular.copy(template),
rows: $scope.model.value.layouts,
columns: $scope.model.value.columns,
view: "views/propertyEditors/grid/dialogs/layoutconfig.html",
size: "small",
submit: function(model) {
submit: function (model) {
if (index === -1) {
$scope.model.value.templates.push(model);
} else {
$scope.model.value.templates[index] = model;
}
editorService.close();
},
close: function(model) {
@@ -119,8 +123,8 @@ angular.module("umbraco")
$scope.configureLayout = function(layout) {
var layoutsCopy = angular.copy($scope.model.value.layouts);
var index = $scope.model.value.layouts.indexOf(layout);
if(layout === undefined){
layout = {
name: "",
@@ -128,16 +132,20 @@ angular.module("umbraco")
]
};
$scope.model.value.layouts.push(layout);
}
var rowConfigOverlay = {
currentRow: layout,
currentRow: angular.copy(layout),
editors: $scope.editors,
columns: $scope.model.value.columns,
view: "views/propertyEditors/grid/dialogs/rowconfig.html",
size: "small",
submit: function(model) {
submit: function (model) {
if (index === -1) {
$scope.model.value.layouts.push(model);
} else {
$scope.model.value.layouts[index] = model;
}
editorService.close();
},
close: function(model) {