bringing the runtime block key back

This commit is contained in:
Niels Lyngsø
2020-06-19 15:08:18 +02:00
parent edf84ca7d7
commit ef1d4cdb7d
2 changed files with 3 additions and 4 deletions

View File

@@ -403,8 +403,6 @@
this.scaffolds = [];
this.watchers = [];
this.isolatedScope = propertyScope.$new(true);
this.isolatedScope.blockObjects = {};
@@ -527,6 +525,7 @@
* The Block Object setups live syncronization of content and settings models back to the data of your Property Editor model.
* The returned object, named ´BlockObject´, contains several usefull models to make editing of this block happen.
* The ´BlockObject´ contains the following properties:
* - key {string}: runtime generated key, usefull for tracking of this object
* - content {Object}: Content model, the content data in a ElementType model.
* - settings {Object}: Settings model, the settings data in a ElementType model.
* - config {Object}: A local deep copy of the block configuration model.
@@ -576,6 +575,7 @@
blockObject.cloneNode = function() {
return null;// angularJS accept this as a cloned value as long as the
}
blockObject.key = String.CreateGuid().replace(/-/g, "");
blockObject.config = Utilities.copy(blockConfiguration);
if (blockObject.config.label && blockObject.config.label !== "") {
blockObject.labelInterpolator = $interpolate(blockObject.config.label);
@@ -763,7 +763,6 @@
delete this.propertyEditorAlias;
delete this.blockConfigurations;
delete this.scaffolds;
delete this.watchers;
this.isolatedScope.$destroy();
delete this.isolatedScope;
}

View File

@@ -6,7 +6,7 @@
<div ui-sortable="vm.sortableOptions" ng-model="vm.layout" ng-if="vm.loading !== true">
<div ng-repeat="layout in vm.layout track by layout.$block.content.udi">
<div ng-repeat="layout in vm.layout track by layout.$block.key">
<button
type="button"