correct behaviour

This commit is contained in:
Niels Lyngsø
2020-07-01 11:45:45 +02:00
parent 22aa76d6b1
commit 69c2ab20ff

View File

@@ -235,7 +235,6 @@
function editBlock(blockObject, openSettings) {
var wasNotActiveBefore = blockObject.active !== true;
activateBlock(blockObject);
// dont open the editor overlay if block has hidden its content editor in overlays and we are requesting to open content, not settings.
if (openSettings !== true && blockObject.hideContentInOverlay === true) {
@@ -243,10 +242,12 @@
}
// if requesting to open settings but we dont have settings then return.
if (openSettings === true && blockObject.config.settingsElementTypeKey) {
if (openSettings === true && !blockObject.config.settingsElementTypeKey) {
return;
}
activateBlock(blockObject);
// make a clone to avoid editing model directly.
var blockContentClone = Utilities.copy(blockObject.content);
var blockSettingsClone = null;
@@ -341,7 +342,11 @@
if(!(mouseEvent.ctrlKey || mouseEvent.metaKey)) {
editorService.close();
if (added && vm.layout.length > createIndex) {
editBlock(vm.layout[createIndex].$block);
if (inlineEditing === true) {
activateBlock(vm.layout[createIndex].$block);
} else if (inlineEditing === false && vm.layout[createIndex].$block.hideContentInOverlay !== true) {
editBlock(vm.layout[createIndex].$block);
}
}
}
},