-
-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New modes, or how to adjust "fixed" mode #266
Comments
Thanks! You can get just moving the nodes with this: editor.on('click', function(e) {
if(e.target.closest(".drawflow_content_node") != null) {
editor.ele_selected = e.target.closest(".drawflow_content_node").parentElement;
if(editor.ele_selected.classList[0] === 'drawflow-node') {
editor.editor_mode = "edit";
}
}
});
editor.on('clickEnd', function(e) {
editor.editor_mode = "fixed";
}); To prevent adding a node you just have to do something similar to this: if(editor.editor_mode !== "fixed") {
// ADD NODE
} else {
alert("Mode fixed! Unblock to add node");
} |
Hi @jerosoler , thanks that works great, is there a way to enable moving the entire flowdiagram in fixed mode as well? |
What do you mean by "moving the entire flow diagram"? |
When I click and hold on the background instead of a node, I can move the entire diagram around. |
By default that already happens. Watch the demo with fixed mode activated. |
Okay, the demo works perfectly. Just what I want. But somehow with my Vue implementation it doesn't work? |
Try with event translate. |
Can you please show a code snippet how to do so? |
editor.on('translate', function(position) {
console.log('Translate x:' + position.x + ' y:'+ position.y);
}) If the data is displayed. It would have to move. |
Okay so there are no logs happening when the mode is fixed. But without fixed mode, I can see the log. 🤔 |
mmmm... |
Two options:
When the user activates it:
|
Your code seems to be correct. It shows me one more thing. The This block cannot have any class assigned. If you want to assign a class to it, first add the class "parent-drawflow" <div id="drawflow"></div> // Correct
<div id="drawflow" class="active"></div> // InCorrect
// Solution for extra class
<div id="drawflow" class="parent-drawflow other-class"></div> Could it be that I add an extra class? |
That's it. I removed the class and now it works just like in the demo 👍 thank you once again 😄 |
Hi,
still in love with your library.
It's great to work with, and now I got another question 😄
Once a user "activates" the flowchart, I would like to set the mode to fixed.
But the user should still be able to move the entire diagram around.
So the only thing that should change is, once the flowchart is active, the user should not be able to:
Is there a way to adjust the fixed mode, so the user is still able to move the nodes around?
In case something looks cluttered and he wants to make it more visually appealing.
Thanks
The text was updated successfully, but these errors were encountered: