Wrap inserted draw.io drawings with a link to the full version as per the gallery image functionality #1270

Open
opened 2026-02-05 00:27:38 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @antontkv on GitHub (Jul 24, 2019).

Describe the feature you'd like
When you insert an image, this image also have a link attached to it, so you can click on it and it will open in full view. This happens with all images, except with the ones that made with draw.io. For this images you have to do "Right click -> View Image". Is it possible to also attach link to this kind of images, so it will open with one click?

Describe the benefits this feature would bring to BookStack users
Less clicks and convenience.

Originally created by @antontkv on GitHub (Jul 24, 2019). **Describe the feature you'd like** When you insert an image, this image also have a link attached to it, so you can click on it and it will open in full view. This happens with all images, except with the ones that made with draw.io. For this images you have to do "Right click -> View Image". Is it possible to also attach link to this kind of images, so it will open with one click? **Describe the benefits this feature would bring to BookStack users** Less clicks and convenience.
OVERLORD added the 🛠️ Enhancement💻 Front-End labels 2026-02-05 00:27:38 +03:00
Author
Owner

@simchanu29 commented on GitHub (Apr 1, 2020):

It seems the same issue as #1170
It would be nice to have this feature.

@simchanu29 commented on GitHub (Apr 1, 2020): It seems the same issue as #1170 It would be nice to have this feature.
Author
Owner

@ssddanbrown commented on GitHub (Apr 2, 2020):

Hey @simchanu29, #1170 refers to links embedded within the drawing. This issue is about wrapping a link around the inserted drawing so you can easily view the full version when clicked, as occurs with standard images.

I'll update the title to clarify this.

@ssddanbrown commented on GitHub (Apr 2, 2020): Hey @simchanu29, #1170 refers to links embedded within the drawing. This issue is about wrapping a link around the inserted drawing so you can easily view the full version when clicked, as occurs with standard images. I'll update the title to clarify this.
Author
Owner

@mv-yurchenko commented on GitHub (Apr 5, 2023):

@ssddanbrown Any info about release of this feature?

@mv-yurchenko commented on GitHub (Apr 5, 2023): @ssddanbrown Any info about release of this feature?
Author
Owner

@ssddanbrown commented on GitHub (Apr 5, 2023):

@mv-yurchenko Nope, adds complication adding in an official way (Where I'd want to do this properly) and has potential considerations/conflicts with other drawing requests, but here's a way to essentially add this functionality to your instance right now, by adding the below to the "Custom HTML Head Content" customization setting:

<script type="module">
    const drawings = document.querySelectorAll('.page-content [drawio-diagram] img');
    for (const drawing of drawings) {
        drawing.addEventListener('click', event => window.open(event.target.src, '_target'));
    }
</script>
<style>
    .page-content [drawio-diagram] img {
        cursor: pointer;
    }
</style>
@ssddanbrown commented on GitHub (Apr 5, 2023): @mv-yurchenko Nope, adds complication adding in an official way (Where I'd want to do this properly) and has potential considerations/conflicts with other drawing requests, but here's a way to essentially add this functionality to your instance right now, by adding the below to the "Custom HTML Head Content" customization setting: ```html <script type="module"> const drawings = document.querySelectorAll('.page-content [drawio-diagram] img'); for (const drawing of drawings) { drawing.addEventListener('click', event => window.open(event.target.src, '_target')); } </script> <style> .page-content [drawio-diagram] img { cursor: pointer; } </style> ```
Author
Owner

@mv-yurchenko commented on GitHub (Apr 11, 2023):

It works for me, thanks a lot!

@mv-yurchenko commented on GitHub (Apr 11, 2023): It works for me, thanks a lot!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1270