mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
First version of sequence mode
This commit is contained in:
parent
1ebfc28d47
commit
0dd97dbc56
@ -207,6 +207,7 @@ $.Viewer = function( options ) {
|
||||
"onfullscreenchange": null
|
||||
};
|
||||
|
||||
this._firstOpen = true;
|
||||
this._updateRequestId = null;
|
||||
this.currentOverlays = [];
|
||||
|
||||
@ -374,7 +375,6 @@ $.Viewer = function( options ) {
|
||||
}
|
||||
|
||||
this.bindStandardControls();
|
||||
this.bindSequenceControls();
|
||||
|
||||
THIS[ this.hash ].prevContainerSize = _getSafeElemSize( this.container );
|
||||
|
||||
@ -505,12 +505,21 @@ $.Viewer = function( options ) {
|
||||
});
|
||||
}
|
||||
|
||||
// Sequence mode
|
||||
if (this.sequenceMode) {
|
||||
THIS[ this.hash ].sequenced = true;
|
||||
this.initialPage = Math.max(0, Math.min(this.tileSources.length - 1, this.initialPage));
|
||||
THIS[ this.hash ].sequence = this.initialPage;
|
||||
this.bindSequenceControls();
|
||||
}
|
||||
|
||||
// Open initial tilesources
|
||||
if ( this.tileSources ) {
|
||||
this.open( this.tileSources );
|
||||
|
||||
if ( this.tileSources.length > 1 ) {
|
||||
if (this.sequenceMode) {
|
||||
this.open(this.tileSources[this.initialPage]);
|
||||
this._updateSequenceButtons( this.initialPage );
|
||||
} else {
|
||||
this.open( this.tileSources );
|
||||
}
|
||||
}
|
||||
|
||||
@ -589,10 +598,12 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
var checkCompletion = function() {
|
||||
if (successes + failures === expected) {
|
||||
if (successes) {
|
||||
if (!_this.preserveViewport) {
|
||||
if (_this._firstOpen || !_this.preserveViewport) {
|
||||
_this.viewport.goHome( true );
|
||||
}
|
||||
|
||||
_this._firstOpen = false;
|
||||
|
||||
var source = tileSources[0];
|
||||
if (source.tileSource) {
|
||||
source = source.tileSource;
|
||||
|
@ -6,7 +6,7 @@
|
||||
init: function() {
|
||||
var self = this;
|
||||
|
||||
var testInitialOpen = false;
|
||||
var testInitialOpen = true;
|
||||
var testOverlays = false;
|
||||
var testMargins = false;
|
||||
var testNavigator = false;
|
||||
@ -16,9 +16,12 @@
|
||||
// debugMode: true,
|
||||
zoomPerScroll: 1.02,
|
||||
showNavigator: testNavigator,
|
||||
collectionMode: true,
|
||||
collectionRows: 3,
|
||||
collectionLayout: 'vertical',
|
||||
sequenceMode: true,
|
||||
navPrevNextWrap: false,
|
||||
preserveViewport: false,
|
||||
// collectionMode: true,
|
||||
// collectionRows: 3,
|
||||
// collectionLayout: 'vertical',
|
||||
// collectionTileSize: 10,
|
||||
// collectionTileMargin: 10,
|
||||
// wrapHorizontal: true,
|
||||
@ -29,12 +32,13 @@
|
||||
|
||||
if (testInitialOpen) {
|
||||
config.tileSources = [
|
||||
// {
|
||||
// tileSource: "../../data/tall.dzi",
|
||||
// x: 1.5,
|
||||
// y: 0,
|
||||
// width: 1
|
||||
// },
|
||||
{
|
||||
tileSource: "../../data/tall.dzi",
|
||||
x: 1.5,
|
||||
y: 0,
|
||||
width: 1
|
||||
}, {
|
||||
tileSource: '../../data/wide.dzi',
|
||||
opacity: 1,
|
||||
x: 0,
|
||||
@ -101,7 +105,7 @@
|
||||
}
|
||||
|
||||
// this.crossTest3();
|
||||
this.collectionTest();
|
||||
// this.collectionTest();
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
Loading…
Reference in New Issue
Block a user