Skip to content

Commit b65d88a

Browse files
authored
Emphasize but unfocus in layout mode (#5125)
1 parent 91cd6a8 commit b65d88a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

modules/@apostrophecms/layout-widget/ui/apos/components/AposAreaLayoutEditor.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,16 @@ export default {
196196
watch: {
197197
// Intercept the columns focus, and emphasize the layout widget instead.
198198
async focusedWidget(widgetId) {
199-
if (!this.parentOptions.widgetId) {
199+
if (!widgetId || !this.parentOptions.widgetId) {
200200
return;
201201
}
202+
202203
await this.$nextTick();
204+
if (widgetId === this.parentOptions.widgetId && this.layoutMode === 'layout') {
205+
this.setFocusedWidget(null, this.areaId);
206+
this.emphasizeGrid();
207+
return;
208+
}
203209
204210
if (this.layoutColumnWidgetDeepIds.includes(widgetId)) {
205211
this.emphasizeGrid();
@@ -215,6 +221,15 @@ export default {
215221
) {
216222
this.setHoveredWidget(this.parentOptions.widgetId, this.areaId);
217223
}
224+
},
225+
layoutMode(newMode) {
226+
if (newMode === 'layout') {
227+
this.setFocusedWidget(null, this.areaId);
228+
this.emphasizeGrid();
229+
} else {
230+
this.setFocusedWidget(this.parentOptions.widgetId, this.areaId);
231+
this.deEmphasizeGrid();
232+
}
218233
}
219234
},
220235
mounted() {

0 commit comments

Comments
 (0)