use retriveValuesFrom method to transfer data.

This commit is contained in:
Niels Lyngsø
2020-06-12 13:35:05 +02:00
parent 6af8a53208
commit 5ad47aa641
2 changed files with 6 additions and 7 deletions

View File

@@ -421,12 +421,12 @@
layoutEntry.settings = null;
}
blockModel.transferDataTo = function(otherBlockModel) {
blockModel.retriveValuesFrom = function(content, settings) {
if (this.content !== null) {
blockEditorService.mapElementValues(this.content, otherBlockModel.content);
mapElementValues(content, this.content);
}
if (this.config.settingsElementTypeKey !== null) {
blockEditorService.mapElementValues(this.settings, otherBlockModel.settings);
mapElementValues(settings, this.settings);
}
}

View File

@@ -223,10 +223,9 @@
view: "views/common/infiniteeditors/blockeditor/blockeditor.html",
size: blockModel.config.editorSize || "medium",
submit: function(blockEditorModel) {
// Now lets syncronize by transfer data back to our blockModel.
blockEditorModel.transferDataTo(blockModel);
blockModel.retriveValuesFrom(blockEditorModel.content, blockEditorModel.settings)
editorService.close();
},
close: function() {