Skip to content

Commit 2a99912

Browse files
committed
Override OpenSeadragon icon URLs within template
rather than requiring OpenSeadragon to be modified.
1 parent 32842a1 commit 2a99912

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

examples/deepzoom/templates/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ <h1>Slide properties</h1>
106106
<script type="text/javascript" src="static/jquery.js"></script>
107107
<script type="text/javascript" src="static/OpenSeadragon.js"></script>
108108
<script type="text/javascript">
109+
// Override hardcoded icon paths
110+
var UnwrappedConfig = Seadragon.Config;
111+
Seadragon.Config = function() {
112+
UnwrappedConfig.apply(this);
113+
$.each(this.navImages, function(k, v) {
114+
$.each(v, function(kk, vv) {
115+
var elements = vv.split('/');
116+
v[kk] = 'static/images/' + elements[elements.length - 1];
117+
});
118+
});
119+
};
120+
109121
$(document).ready(function() {
110122
var dzi_data = {{ dzi_data|default('{}')|safe }};
111123
var viewer;

0 commit comments

Comments
 (0)