mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-19 17:21:50 +03:00
IE8 fixes for DZI and World.removeItem
This commit is contained in:
parent
b22864ca6e
commit
28b1296105
@ -107,8 +107,10 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead
|
|||||||
var ns;
|
var ns;
|
||||||
if ( data.Image ) {
|
if ( data.Image ) {
|
||||||
ns = data.Image.xmlns;
|
ns = data.Image.xmlns;
|
||||||
} else if ( data.documentElement && "Image" == data.documentElement.localName ) {
|
} else if ( data.documentElement) {
|
||||||
ns = data.documentElement.namespaceURI;
|
if ("Image" == data.documentElement.localName || "Image" == data.documentElement.tagName) {
|
||||||
|
ns = data.documentElement.namespaceURI;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ( "http://schemas.microsoft.com/deepzoom/2008" == ns ||
|
return ( "http://schemas.microsoft.com/deepzoom/2008" == ns ||
|
||||||
@ -221,7 +223,7 @@ function configureFromXML( tileSource, xmlDoc ){
|
|||||||
}
|
}
|
||||||
|
|
||||||
var root = xmlDoc.documentElement,
|
var root = xmlDoc.documentElement,
|
||||||
rootName = root.localName,
|
rootName = root.localName || root.tagName,
|
||||||
ns = xmlDoc.documentElement.namespaceURI,
|
ns = xmlDoc.documentElement.namespaceURI,
|
||||||
configuration = null,
|
configuration = null,
|
||||||
displayRects = [],
|
displayRects = [],
|
||||||
@ -234,7 +236,10 @@ function configureFromXML( tileSource, xmlDoc ){
|
|||||||
if ( rootName == "Image" ) {
|
if ( rootName == "Image" ) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sizeNode = root.getElementsByTagNameNS(ns, "Size" )[ 0 ];
|
sizeNode = root.getElementsByTagName("Size" )[ 0 ];
|
||||||
|
if (sizeNode === undefined) {
|
||||||
|
sizeNode = root.getElementsByTagNameNS(ns, "Size" )[ 0 ];
|
||||||
|
}
|
||||||
|
|
||||||
configuration = {
|
configuration = {
|
||||||
Image: {
|
Image: {
|
||||||
@ -257,11 +262,17 @@ function configureFromXML( tileSource, xmlDoc ){
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
dispRectNodes = root.getElementsByTagNameNS(ns, "DisplayRect" );
|
dispRectNodes = root.getElementsByTagName("DisplayRect" );
|
||||||
|
if (dispRectNodes === undefined) {
|
||||||
|
dispRectNodes = root.getElementsByTagNameNS(ns, "DisplayRect" )[ 0 ];
|
||||||
|
}
|
||||||
|
|
||||||
for ( i = 0; i < dispRectNodes.length; i++ ) {
|
for ( i = 0; i < dispRectNodes.length; i++ ) {
|
||||||
dispRectNode = dispRectNodes[ i ];
|
dispRectNode = dispRectNodes[ i ];
|
||||||
rectNode = dispRectNode.getElementsByTagNameNS(ns, "Rect" )[ 0 ];
|
rectNode = dispRectNode.getElementsByTagName("Rect" )[ 0 ];
|
||||||
|
if (rectNode === undefined) {
|
||||||
|
rectNode = dispRectNode.getElementsByTagNameNS(ns, "Rect" )[ 0 ];
|
||||||
|
}
|
||||||
|
|
||||||
displayRects.push({
|
displayRects.push({
|
||||||
Rect: {
|
Rect: {
|
||||||
|
@ -177,7 +177,7 @@ $.extend( $.World.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.W
|
|||||||
removeItem: function( item ) {
|
removeItem: function( item ) {
|
||||||
$.console.assert(item, "[World.removeItem] item is required");
|
$.console.assert(item, "[World.removeItem] item is required");
|
||||||
|
|
||||||
var index = this._items.indexOf( item );
|
var index = $.indexOf(this._items, item );
|
||||||
if ( index === -1 ) {
|
if ( index === -1 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -6,23 +6,24 @@
|
|||||||
init: function() {
|
init: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var testInitialOpen = false;
|
var testInitialOpen = true;
|
||||||
var testOverlays = false;
|
var testOverlays = false;
|
||||||
var testMargins = false;
|
var testMargins = false;
|
||||||
var testNavigator = true;
|
var testNavigator = false;
|
||||||
var margins;
|
var margins;
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
// debugMode: true,
|
// debugMode: true,
|
||||||
zoomPerScroll: 1.02,
|
zoomPerScroll: 1.02,
|
||||||
showNavigator: testNavigator,
|
showNavigator: testNavigator,
|
||||||
|
useCanvas: true,
|
||||||
// sequenceMode: true,
|
// sequenceMode: true,
|
||||||
// showReferenceStrip: true,
|
// showReferenceStrip: true,
|
||||||
// referenceStripScroll: 'vertical',
|
// referenceStripScroll: 'vertical',
|
||||||
navPrevNextWrap: false,
|
navPrevNextWrap: false,
|
||||||
preserveViewport: false,
|
preserveViewport: false,
|
||||||
collectionMode: true,
|
collectionMode: true,
|
||||||
// collectionRows: 3,
|
collectionRows: 1,
|
||||||
// collectionLayout: 'vertical',
|
// collectionLayout: 'vertical',
|
||||||
// collectionTileSize: 10,
|
// collectionTileSize: 10,
|
||||||
// collectionTileMargin: 10,
|
// collectionTileMargin: 10,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user