Optionally pass block view from editor view + enforce editor view + rename simplelist block view
This commit is contained in:
+2
-3
@@ -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"
|
||||
};
|
||||
}
|
||||
]);
|
||||
|
||||
+5
-1
@@ -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
|
||||
};
|
||||
}
|
||||
]);
|
||||
|
||||
+2
-2
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user