From b5b971a1894bec00a527e324e4ff48ee053b6c52 Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 21 May 2018 16:32:13 +0200 Subject: [PATCH] Fixes the editors that load --- .../propertyeditors/grid2/grid2.controller.js | 15 +++++++++------ .../src/views/propertyeditors/grid2/grid2.html | 3 +++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid2/grid2.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid2/grid2.controller.js index b46276882b..32b25dfc5f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid2/grid2.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid2/grid2.controller.js @@ -592,7 +592,11 @@ angular.module("umbraco") function getEditor(alias) { return _.find($scope.availableEditors, function (editor) { return editor.alias === alias; }); - }; + } + + function getEditorByUdi(udi) { + return _.find($scope.availableEditors, function (editor) { return editor.udi === udi; }); + } $scope.removeControl = function (cell, $index) { $scope.currentControl = null; @@ -806,14 +810,13 @@ angular.module("umbraco") _.each(item.properties, function (p) { p.$uniqueId = guid(); p.hideLabel = true; - p.value = item.values[p.alias]; - return; - //fixme - we probably don't need to do this any more + var editor = getEditorByUdi(item.type); + //now we need to re-assign the view and set the boolean if it's a preview or not - if (item.editor.views && item.editor.views[p.alias]) { - p.view = item.editor.views[p.alias].view; + if (editor.views && editor.views[p.alias]) { + p.view = editor.views[p.alias].view; } }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid2/grid2.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid2/grid2.html index d14e3299d0..cfdb083ed3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid2/grid2.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid2/grid2.html @@ -298,6 +298,9 @@
     {{model.value | json}}
     
+
+    {{availableEditors | json}}
+