diff --git a/src/openseadragon.js b/src/openseadragon.js index bc6e5e59..d7f63116 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -433,10 +433,10 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ */ /* jshint ignore:start */ $.version = { - versionStr: '<%= osdVersion.versionStr %>', - major: <%= osdVersion.major %>, - minor: <%= osdVersion.minor %>, - revision: <%= osdVersion.revision %> +// versionStr: '<%= osdVersion.versionStr %>', +// major: <%= osdVersion.major %>, +// minor: <%= osdVersion.minor %>, +// revision: <%= osdVersion.revision %> }; /* jshint ignore:end */ @@ -1347,7 +1347,9 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ */ indexOf: function( array, searchElement, fromIndex ) { if ( Array.prototype.indexOf ) { - this.indexOf = Array.prototype.indexOf; + this.indexOf = function( array, searchElement, fromIndex ) { + return array.indexOf( searchElement, fromIndex ); + }; } else { this.indexOf = function( array, searchElement, fromIndex ) { var i, diff --git a/src/viewer.js b/src/viewer.js index 2724a5ae..62de5ccc 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1044,11 +1044,16 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, * @memberOf OpenSeadragon.Viewer * @type {object} * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event. + * @property {Object} options The options passed to the addLayer method. * @property {OpenSeadragon.Drawer} drawer The layer's underlying drawer. * @property {?Object} userData - Arbitrary subscriber-defined object. */ - _this.raiseEvent( 'add-layer', { drawer: drawer } ); + _this.raiseEvent( 'add-layer', { + options: options, + drawer: drawer + }); }, function( event ) { + event.options = options; /** * Raised when an error occurs while adding a layer. * @event add-layer-failed @@ -1057,6 +1062,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event. * @property {String} message * @property {String} source + * @property {Object} options The options passed to the addLayer method. * @property {?Object} userData - Arbitrary subscriber-defined object. */ _this.raiseEvent( 'add-layer-failed', event ); @@ -1496,7 +1502,7 @@ function _getSafeElemSize (oElement) { * @private */ function getTileSourceImplementation( viewer, tileSource, successCallback, - failCallback) { + failCallback ) { var _this = viewer; //allow plain xml strings or json strings to be parsed here diff --git a/test/data/A.png b/test/data/A.png new file mode 100644 index 00000000..dde07443 Binary files /dev/null and b/test/data/A.png differ diff --git a/test/data/BBlue.png b/test/data/BBlue.png new file mode 100644 index 00000000..055d7ff4 Binary files /dev/null and b/test/data/BBlue.png differ diff --git a/test/data/CCyan.png b/test/data/CCyan.png new file mode 100644 index 00000000..40e56de2 Binary files /dev/null and b/test/data/CCyan.png differ diff --git a/test/data/DDandelion.png b/test/data/DDandelion.png new file mode 100644 index 00000000..fdc849f2 Binary files /dev/null and b/test/data/DDandelion.png differ diff --git a/test/demo/layers.html b/test/demo/layers.html new file mode 100644 index 00000000..b1053b96 --- /dev/null +++ b/test/demo/layers.html @@ -0,0 +1,131 @@ + + +
+