Added note edit flags

This commit is contained in:
Mitchell McCaffrey
2020-11-05 16:21:52 +11:00
parent 8873e59205
commit 6fedcc171d
5 changed files with 27 additions and 3 deletions

View File

@@ -40,6 +40,7 @@ function Map({
allowMapDrawing,
allowFogDrawing,
allowMapChange,
allowNoteEditing,
disabledTokens,
session,
}) {
@@ -138,7 +139,6 @@ function Map({
disabledControls.push("pan");
disabledControls.push("measure");
disabledControls.push("pointer");
disabledControls.push("note");
}
if (!allowFogDrawing) {
disabledControls.push("fog");
@@ -146,6 +146,9 @@ function Map({
if (!allowMapChange) {
disabledControls.push("map");
}
if (!allowNoteEditing) {
disabledControls.push("note");
}
const disabledSettings = { fog: [], drawing: [] };
if (mapShapes.length === 0) {
@@ -399,7 +402,10 @@ function Map({
: []
}
onNoteMenuOpen={handleNoteMenuOpen}
draggable={selectedToolId === "note" || selectedToolId === "pan"}
draggable={
allowNoteEditing &&
(selectedToolId === "note" || selectedToolId === "pan")
}
onNoteDragStart={(e, noteId) =>
setNoteDraggingOptions({ dragging: true, noteId, noteGroup: e.target })
}