Open iuliabalan opened 6 years ago
I checked the draw.io code and ATM it doesn't seem to support specifying the target (e.g. target=blank
) per link. The target can be configured per diagram (it affects all the links from the diagram). They call it "link policy", and the supported values are:
target=[auto|self|frame|blank]: Opens links in the same window or frame or in a blank window in chromeless mode (auto is default and opens relative links and anchors in same window in chromeless mode, and all links in new window in editing mode)
See https://www.diagrams.net/doc/faq/supported-url-parameters
There's no UI for this though. We should consider the following options:
Diagram.DiagramViewSheet
JSX and change
var urlParams = {};
with
var urlParams = {target: 'blank'};
Diagram.DiagramClass
to control how links are opened. We would read this property in Diagram.DiagramViewSheet
and set the urlParams
accordingly.Graph#labelLinkClicked
or GraphViewer#addClickHandler
to implement a custom behavior (determine how to open the link based on the link URL or some attribute).Link policy is currently read from urlParams
, see Graph#linkPolicy.
Currently if you add a link to diagram elements you only have the option to insert the URL. The links to external ressources are opened in new tab. If you have a link to a document from your wiki (e.g a PDF document) it's opening it in the same window. It would be nice to be able to configure the link to open in a new tab like it can be done if editing a link in CKEditor