Ma77Ball commented on code in PR #3602:
URL: https://github.com/apache/texera/pull/3602#discussion_r2366388724
##########
core/gui/src/app/workspace/service/joint-ui/joint-ui.service.ts:
##########
@@ -510,6 +510,51 @@ export class JointUIService {
});
}
+ private static RemoveButton: new () => joint.linkTools.Button; // private
static property to cache the button class.
+
+ public getRemoveButton(): new () => joint.linkTools.Button {
+ // Check if the class has already been created.
+ if (!JointUIService.RemoveButton) {
+ // If not, create it ONCE and store it in the static property.
+ JointUIService.RemoveButton = joint.linkTools.Button.extend({
+ name: "remove-button",
+ options: {
+ markup: [
+ {
+ tagName: "circle",
+ selector: "button",
+ attributes: {
+ r: 11,
+ fill: "#D8656A",
+ cursor: "pointer",
+ },
+ },
+ {
+ tagName: "path",
+ selector: "icon",
+ attributes: {
+ d: "M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585
16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419
10.946,24.248 16.447,18.746 21.948,24.248z",
Review Comment:
The shape was added because, before, only the info button was made using
JointJS, so the delete button could not be placed x distance from the right, as
it used CSS. I had to give a shape to accomplish the pr.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]