UPDATE: change text with contextmenu click

This commit is contained in:
2025-11-22 11:03:04 +01:00
parent 1541d62bb5
commit 11c2222536
2 changed files with 6 additions and 3 deletions

View File

@@ -61,6 +61,7 @@
width: window.innerWidth,
height: window.innerHeight,
gridSize: 20,
preventContextMenu: false,
});
const $resizeHandle = $('#resize-handle');
@@ -377,8 +378,10 @@
});
//add text to text block - START
paper.on('element:pointerdblclick', function (elementView) {
paper.on('element:contextmenu', function (elementView,ev) {
ev.preventDefault();
if (elementView.model.attributes.type === 'standard.TextBlock') {
const currentText = elementView.model.attr('label/text');
const newText = prompt('Edytuj tekst:', currentText);
if (newText != null) {