In clipboard copy paste, the custom function of the object can't be copied, how do I do it? #2808
Unanswered
james-ep01
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You can not have the clipboard's It's the same as you would serialize the graph and send to backend with Why don't you add the method to the prototype of the class? const Shape = dia.Element.extends({
setPower: function() { /* ... */ }
});
const shape = new Shape();
shape.setPower(); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
Below is the class I made and am using. I'm using my own variables and functions.
The code below is a copy and paste code.
I printed it out as console in copy and paste, but you can see that the custom variables are pasted as they are, but the custom
function disappears when pasted.
What is the problem?
Steps to reproduce
No response
Restrictions & Constraints
No response
Does your question relate to JointJS or JointJS+. Select both if applicable.
JointJS+
Beta Was this translation helpful? Give feedback.
All reactions