mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-16 14:53:14 +03:00
Added configuration parameter to allow a horizontal layout that has a fixed number of columns or a vertical layout that has a fixed number of rows.
This commit is contained in:
parent
6db00ad286
commit
339401683f
@ -559,6 +559,10 @@
|
||||
* If collectionMode is true, specifies how many rows the grid should have. Use 1 to make a line.
|
||||
* If collectionLayout is 'vertical', specifies how many columns instead.
|
||||
*
|
||||
* @property {Number} [collectionColumns=0]
|
||||
* If collectionMode is true, specifies how many columns the grid should have. Use 1 to make a line.
|
||||
* If collectionLayout is 'vertical', specifies how many rows instead. Ignored if collectionRows is not set to a falsy value.
|
||||
*
|
||||
* @property {String} [collectionLayout='horizontal']
|
||||
* If collectionMode is true, specifies whether to arrange vertically or horizontally.
|
||||
*
|
||||
@ -1039,6 +1043,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
||||
|
||||
//COLLECTION VISUALIZATION SETTINGS
|
||||
collectionRows: 3, //or columns depending on layout
|
||||
collectionColumns: 0, //columns in horizontal layout, rows in vertical layout
|
||||
collectionLayout: 'horizontal', //vertical
|
||||
collectionMode: false,
|
||||
collectionTileSize: 800,
|
||||
|
@ -1318,6 +1318,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
_this.world.arrange({
|
||||
immediately: queueItem.options.collectionImmediately,
|
||||
rows: _this.collectionRows,
|
||||
columns: _this.collectionColumns,
|
||||
layout: _this.collectionLayout,
|
||||
tileSize: _this.collectionTileSize,
|
||||
tileMargin: _this.collectionTileMargin
|
||||
|
@ -281,6 +281,7 @@ $.extend( $.World.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.W
|
||||
* @param {Boolean} [options.immediately=false] - Whether to animate to the new arrangement.
|
||||
* @param {String} [options.layout] - See collectionLayout in {@link OpenSeadragon.Options}.
|
||||
* @param {Number} [options.rows] - See collectionRows in {@link OpenSeadragon.Options}.
|
||||
* @param {Number} [options.columns] - See collectionColumns in {@link OpenSeadragon.Options}.
|
||||
* @param {Number} [options.tileSize] - See collectionTileSize in {@link OpenSeadragon.Options}.
|
||||
* @param {Number} [options.tileMargin] - See collectionTileMargin in {@link OpenSeadragon.Options}.
|
||||
* @fires OpenSeadragon.World.event:metrics-change
|
||||
@ -290,10 +291,16 @@ $.extend( $.World.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.W
|
||||
var immediately = options.immediately || false;
|
||||
var layout = options.layout || $.DEFAULT_SETTINGS.collectionLayout;
|
||||
var rows = options.rows || $.DEFAULT_SETTINGS.collectionRows;
|
||||
var columns = options.columns || $.DEFAULT_SETTINGS.collectionColumns;
|
||||
var tileSize = options.tileSize || $.DEFAULT_SETTINGS.collectionTileSize;
|
||||
var tileMargin = options.tileMargin || $.DEFAULT_SETTINGS.collectionTileMargin;
|
||||
var increment = tileSize + tileMargin;
|
||||
var wrap = Math.ceil(this._items.length / rows);
|
||||
var wrap;
|
||||
if (!options.rows && columns) {
|
||||
wrap = columns;
|
||||
} else {
|
||||
wrap = Math.ceil(this._items.length / rows);
|
||||
}
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
var item, box, width, height, position;
|
||||
|
Loading…
x
Reference in New Issue
Block a user