Skip to content

Commit

Permalink
fix(modules): allow dragging + clicking on whole module, not only title
Browse files Browse the repository at this point in the history
closes #28

Signed-off-by: Lukas Mertens <git@lukas-mertens.de>

commit-id:f01c6642
  • Loading branch information
lukas-mertens committed Mar 13, 2024
1 parent f775ff4 commit 9c72bc9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/modules/evconf_konva/views/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default class ModuleView {
y: 2,
},
fillAfterStrokeEnabled: true,
listening: false,
listening: true,
});

const title = new Konva.Text({
Expand All @@ -149,15 +149,17 @@ export default class ModuleView {
listening: true,
});

title.on("mouseenter", () => {
this._vm.set_cursor("pointer");
});
title.on("mouseleave", () => {
this._vm.set_cursor("default");
});
title.on("pointerclick", (ev) => {
this._vm.clicked_title();
ev.cancelBubble = true;
[frame, title].forEach(e => {
e.on("mouseenter", () => {
this._vm.set_cursor("pointer");
});
e.on("mouseleave", () => {
this._vm.set_cursor("default");
});
e.on("pointerclick", (ev) => {
this._vm.clicked_title();
ev.cancelBubble = true;
})
});

this._title = title;
Expand Down

0 comments on commit 9c72bc9

Please sign in to comment.