diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/rowdeleteconfirm.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/rowdeleteconfirm.controller.js
new file mode 100644
index 0000000000..10b5601304
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/rowdeleteconfirm.controller.js
@@ -0,0 +1,16 @@
+function DeleteRowConfirmController($scope) {
+
+ $scope.close = function() {
+ if($scope.model.close) {
+ $scope.model.close();
+ }
+ }
+
+ $scope.submit = function() {
+ if($scope.model && $scope.model.submit) {
+ $scope.model.submit($scope.model);
+ }
+ }
+}
+
+angular.module("umbraco").controller("Umbraco.PropertyEditors.GridPrevalueEditor.DeleteRowConfirmController", DeleteRowConfirmController);
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/rowdeleteconfirm.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/rowdeleteconfirm.html
index c69ae2cb8f..2bf1f00b0e 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/rowdeleteconfirm.html
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/rowdeleteconfirm.html
@@ -1,4 +1,13 @@
-
+
+
+
+
+
+
+
+
+
+
Warning!
@@ -15,4 +24,31 @@
Are you sure?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.controller.js
index 19057fa842..d38697d351 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.controller.js
@@ -1,6 +1,6 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.GridPrevalueEditorController",
- function ($scope, gridService) {
+ function ($scope, gridService, editorService) {
var emptyModel = {
styles:[
@@ -89,28 +89,23 @@ angular.module("umbraco")
};
$scope.model.value.templates.push(template);
}
+
+ var layoutConfigOverlay = {
+ currentLayout: template,
+ rows: $scope.model.value.layouts,
+ columns: $scope.model.value.columns,
+ view: "views/propertyEditors/grid/dialogs/layoutconfig.html",
+ size: "small",
+ submit: function(model) {
+ editorService.close();
+ },
+ close: function(model) {
+ editorService.close();
+ }
+ };
- $scope.layoutConfigOverlay = {};
- $scope.layoutConfigOverlay.view = "views/propertyEditors/grid/dialogs/layoutconfig.html";
- $scope.layoutConfigOverlay.currentLayout = template;
- $scope.layoutConfigOverlay.rows = $scope.model.value.layouts;
- $scope.layoutConfigOverlay.columns = $scope.model.value.columns;
- $scope.layoutConfigOverlay.show = true;
+ editorService.open(layoutConfigOverlay);
- $scope.layoutConfigOverlay.submit = function(model) {
- $scope.layoutConfigOverlay.show = false;
- $scope.layoutConfigOverlay = null;
- };
-
- $scope.layoutConfigOverlay.close = function(oldModel) {
-
- //reset templates
- $scope.model.value.templates = templatesCopy;
-
- $scope.layoutConfigOverlay.show = false;
- $scope.layoutConfigOverlay = null;
- }
-
};
$scope.deleteTemplate = function(index){
@@ -135,50 +130,44 @@ angular.module("umbraco")
};
$scope.model.value.layouts.push(layout);
}
-
- $scope.rowConfigOverlay = {};
- $scope.rowConfigOverlay.view = "views/propertyEditors/grid/dialogs/rowconfig.html";
- $scope.rowConfigOverlay.currentRow = layout;
- $scope.rowConfigOverlay.editors = $scope.editors;
- $scope.rowConfigOverlay.columns = $scope.model.value.columns;
- $scope.rowConfigOverlay.show = true;
-
- $scope.rowConfigOverlay.submit = function(model) {
- $scope.rowConfigOverlay.show = false;
- $scope.rowConfigOverlay = null;
- };
-
- $scope.rowConfigOverlay.close = function(oldModel) {
- $scope.model.value.layouts = layoutsCopy;
- $scope.rowConfigOverlay.show = false;
- $scope.rowConfigOverlay = null;
+
+ var rowConfigOverlay = {
+ currentRow: layout,
+ editors: $scope.editors,
+ columns: $scope.model.value.columns,
+ view: "views/propertyEditors/grid/dialogs/rowconfig.html",
+ size: "small",
+ submit: function(model) {
+ editorService.close();
+ },
+ close: function(model) {
+ editorService.close();
+ }
};
+ editorService.open(rowConfigOverlay);
+
};
//var rowDeletesPending = false;
$scope.deleteLayout = function(index) {
+
+ var rowDeleteOverlay = {
+ dialogData: {
+ rowName: $scope.model.value.layouts[index].name
+ },
+ view: "views/propertyEditors/grid/dialogs/rowdeleteconfirm.html",
+ size: "small",
+ submit: function(model) {
+ $scope.model.value.layouts.splice(index, 1);
+ editorService.close();
+ },
+ close: function(model) {
+ editorService.close();
+ }
+ };
- $scope.rowDeleteOverlay = {};
- $scope.rowDeleteOverlay.view = "views/propertyEditors/grid/dialogs/rowdeleteconfirm.html";
- $scope.rowDeleteOverlay.dialogData = {
- rowName: $scope.model.value.layouts[index].name
- };
- $scope.rowDeleteOverlay.show = true;
-
- $scope.rowDeleteOverlay.submit = function(model) {
-
- $scope.model.value.layouts.splice(index, 1);
-
- $scope.rowDeleteOverlay.show = false;
- $scope.rowDeleteOverlay = null;
- };
-
- $scope.rowDeleteOverlay.close = function(oldModel) {
- $scope.rowDeleteOverlay.show = false;
- $scope.rowDeleteOverlay = null;
- };
-
+ editorService.open(rowDeleteOverlay);
};
@@ -210,26 +199,22 @@ angular.module("umbraco")
};
var editConfigCollection = function(configValues, title, callback) {
+
+ var editConfigCollectionOverlay = {
+ config: configValues,
+ title: title,
+ view: "views/propertyeditors/grid/dialogs/editconfig.html",
+ size: "small",
+ submit: function(model) {
+ callback(model.config);
+ editorService.close();
+ },
+ close: function(model) {
+ editorService.close();
+ }
+ };
- $scope.editConfigCollectionOverlay = {};
- $scope.editConfigCollectionOverlay.view = "views/propertyeditors/grid/dialogs/editconfig.html";
- $scope.editConfigCollectionOverlay.config = configValues;
- $scope.editConfigCollectionOverlay.title = title;
- $scope.editConfigCollectionOverlay.show = true;
-
- $scope.editConfigCollectionOverlay.submit = function(model) {
-
- callback(model.config);
-
- $scope.editConfigCollectionOverlay.show = false;
- $scope.editConfigCollectionOverlay = null;
- };
-
- $scope.editConfigCollectionOverlay.close = function(oldModel) {
- $scope.editConfigCollectionOverlay.show = false;
- $scope.editConfigCollectionOverlay = null;
- };
-
+ editorService.open(editConfigCollectionOverlay);
};
$scope.editConfig = function() {
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.html
index 539433821b..92d1a9ef26 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.html
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.html
@@ -158,28 +158,4 @@