Refactor block view specification in the block directive
This commit is contained in:
+2
-2
@@ -1,12 +1,12 @@
|
||||
angular.module("umbraco.directives").directive('umbBlockEditorBlock', [
|
||||
function () {
|
||||
var link = function (scope, el, attr, ctrl) {
|
||||
scope.view = attr.view;
|
||||
scope.view = attr.view || "views/propertyeditors/blockeditor/blockeditor.block.default.html";
|
||||
};
|
||||
|
||||
return {
|
||||
restrict: "E",
|
||||
templateUrl: "views/propertyeditors/blockeditor/blockeditor.block.html",
|
||||
template: "<div ng-include='view'></div>",
|
||||
link: link
|
||||
};
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<div>
|
||||
<div>
|
||||
<div style="cursor:pointer" ng-click="vm.editSettings(block)" class="di">
|
||||
<i class="icon icon-settings"></i>
|
||||
</div>
|
||||
<div style="cursor:pointer" ng-click="vm.remove(block)" class="di">
|
||||
<i class="icon icon-trash"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div style="cursor:pointer" ng-click="vm.editContent(block)">
|
||||
Eventually a block identifier will go here (e.g. element type icon)
|
||||
</div>
|
||||
</div>
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
<div class="handle" >
|
||||
<div ng-if="view" ng-include="view"></div>
|
||||
<div ng-if="!view">
|
||||
<div>
|
||||
<div style="cursor:pointer" ng-click="vm.editSettings(block)" class="di">
|
||||
<i class="icon icon-settings"></i>
|
||||
</div>
|
||||
<div style="cursor:pointer" ng-click="vm.remove(block)" class="di">
|
||||
<i class="icon icon-trash"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div style="cursor:pointer" ng-click="vm.editContent(block)">
|
||||
Eventually a block identifier will go here (e.g. element type icon)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
<div ng-controller="Umbraco.PropertyEditors.BlockEditor.DefaultController">
|
||||
<ul class="unstyled" ui-sortable="sortableOptions" ng-model="blocks">
|
||||
<li ng-repeat="block in blocks" style="border: 1px solid silver; margin-bottom: 4px; padding: 4px;">
|
||||
<umb-block-editor-block></umb-block-editor-block>
|
||||
<div class="handle">
|
||||
<umb-block-editor-block></umb-block-editor-block>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user