mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
removed polling vs resizeviewer option from demo
This commit is contained in:
parent
67fc9eafe8
commit
564121428c
@ -98,13 +98,6 @@
|
|||||||
<p>These options apply to both of the demo viewers on the left (top and bottom).</p>
|
<p>These options apply to both of the demo viewers on the left (top and bottom).</p>
|
||||||
<div class="options">
|
<div class="options">
|
||||||
|
|
||||||
<div class="method listener-method selected" data-value="0">
|
|
||||||
<pre>Use polling</pre>
|
|
||||||
</div>
|
|
||||||
<div class="method listener-method" data-value="1">
|
|
||||||
<pre>Use ResizeObserver</pre>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method preserve-method selected" data-value="0">
|
<div class="method preserve-method selected" data-value="0">
|
||||||
<pre>preserveImageSizeOnResize: false</pre>
|
<pre>preserveImageSizeOnResize: false</pre>
|
||||||
</div>
|
</div>
|
||||||
@ -169,22 +162,7 @@
|
|||||||
|
|
||||||
function updateViewer(){
|
function updateViewer(){
|
||||||
viewer.preserveImageSizeOnResize = !!parseInt($('.preserve-method.selected').data('value'));
|
viewer.preserveImageSizeOnResize = !!parseInt($('.preserve-method.selected').data('value'));
|
||||||
|
|
||||||
viewer.autoResize = !!parseInt($('.auto-method.selected').data('value'));
|
viewer.autoResize = !!parseInt($('.auto-method.selected').data('value'));
|
||||||
|
|
||||||
var useResizeObserver=!!parseInt($('.listener-method.selected').data('value'));
|
|
||||||
if(useResizeObserver){
|
|
||||||
if(viewer._resizeObserver && viewer._autoResizePolling){
|
|
||||||
viewer._resizeObserver.observe(viewer.container);
|
|
||||||
viewer._autoResizePolling = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(viewer._resizeObserver && !viewer._autoResizePolling){
|
|
||||||
viewer._resizeObserver.observe(viewer.container);
|
|
||||||
viewer._autoResizePolling = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.preserve-method').on('click',function(){
|
$('.preserve-method').on('click',function(){
|
||||||
@ -197,15 +175,6 @@
|
|||||||
$(this).addClass('selected');
|
$(this).addClass('selected');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if(!window.ResizeObserver){
|
|
||||||
$('.listener-method[data-value=1]').text('ResizeObserver not support in your browser').addClass('invalid');
|
|
||||||
}
|
|
||||||
$('.listener-method').on('click',function(){
|
|
||||||
$('.listener-method').removeClass('selected');
|
|
||||||
if(!$(this).hasClass('invalid')) $(this).addClass('selected');
|
|
||||||
})
|
|
||||||
|
|
||||||
$('.method').on('click',updateViewer);
|
$('.method').on('click',updateViewer);
|
||||||
|
|
||||||
var container = $('.inner-container');
|
var container = $('.inner-container');
|
||||||
|
Loading…
Reference in New Issue
Block a user