use retriveValuesFrom method to transfer data.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user