Optionally pass block view from editor view + enforce editor view + rename simplelist block view

This commit is contained in:
Kenn Jacobsen
2019-05-27 21:22:43 +02:00
parent 5c7a519372
commit 97896e96af
5 changed files with 10 additions and 7 deletions
@@ -5,12 +5,11 @@
templateUrl: "views/propertyeditors/blockeditor/blockeditor.directive.html",
scope: {
config: "=",
view: "=?",
view: "@",
blocks: "="
},
controller: "Umbraco.PropertyEditors.BlockEditor.DirectiveController",
controllerAs: "vm",
controllerAs: "vm"
};
}
]);
@@ -1,8 +1,12 @@
angular.module("umbraco.directives").directive('umbBlockEditorBlock', [
function () {
var link = function (scope, el, attr, ctrl) {
scope.view = scope.block.view || attr.view;
};
return {
restrict: "E",
template: "<div ng-include='block.settings.view'></div>",
template: "<div ng-include='view'></div>",
link: link
};
}
]);
@@ -1,8 +1,8 @@
<div ng-controller="Umbraco.PropertyEditors.BlockEditor.SimpleListController">
<ul class="unstyled" ui-sortable="sortableOptions" ng-model="blocks">
<li ng-repeat="block in blocks" class="handle">
<li ng-repeat="block in blocks">
<div class="handle">
<umb-block-editor-block></umb-block-editor-block>
<umb-block-editor-block view="views/propertyeditors/blockeditor/blockeditor.simplelist.block.html"></umb-block-editor-block>
</div>
</li>
</ul>
@@ -1 +1 @@
<umb-block-editor blocks="model.value" config="model.config.blocks"></umb-block-editor>
<umb-block-editor blocks="model.value" config="model.config.blocks" view="views/propertyeditors/blockeditor/blockeditor.simplelist.html"></umb-block-editor>