Skip to content

Commit b8da3d2

Browse files
authored
Ignore viz.image on screenshooting (#329)
1 parent 8901529 commit b8da3d2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ckanext/querytool/fanstatic/javascript/public_query.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@
237237
});
238238

239239
html2canvas(document.body, {
240+
//fix images
241+
ignoreElements: function(element) {
242+
if (element.className == 'html2canvas-ignore') return true;
243+
},
240244
}).then(function(canvas) {
241245
Canvas2Image.saveAsPNG(canvas);
242246
});

ckanext/querytool/templates/querytool/public/read.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
{% endif %}
164164
{% if item.type == 'image' %}
165165
<div class="item-content" >
166-
<img src="{{ item.url }}">
166+
<img src="{{ item.url }}" class="html2canvas-ignore">
167167
</div>
168168
{% endif %}
169169
{% if item.type == 'map' %}

0 commit comments

Comments
 (0)