mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Implemented and documented fallback behavior
This commit is contained in:
parent
7a8ebd7d4c
commit
8a3ec97596
@ -54,7 +54,9 @@ $.ControlAnchor = {
|
||||
* element.
|
||||
* @class
|
||||
* @param {Element} element - the control element to be anchored in the container.
|
||||
* @param {Object} options - All required and optional settings for configuring a control element
|
||||
* @param {Object | OpenSeadragon.ControlAnchor } options - All required and optional settings for configuring a control element. A deprecated
|
||||
* alternative to passing an object with properties is to just pass an OpenSeadragon.ControlAnchor. The target
|
||||
* removal date for this deprecated alternative is December 2013.
|
||||
* @param {OpenSeadragon.ControlAnchor} [options.anchor=OpenSeadragon.ControlAnchor.NONE] - the position of the control
|
||||
* relative to the container.
|
||||
* @param {Boolean} [options.attachToViewer=true] - Whether the control should be added directly to the viewer, or
|
||||
@ -74,6 +76,11 @@ $.ControlAnchor = {
|
||||
*/
|
||||
$.Control = function ( element, options, container ) {
|
||||
var parent = element.parentNode;
|
||||
//Deprecated. Target removal date is December 2013
|
||||
if (typeof options === 'number')
|
||||
{
|
||||
options = {anchor: options};
|
||||
}
|
||||
options.attachToViewer = (typeof options.attachToViewer === 'undefined') ? true : options.attachToViewer;
|
||||
this.autoFade = (typeof options.autoFade === 'undefined') ? true : options.autoFade;
|
||||
this.element = element;
|
||||
|
Loading…
Reference in New Issue
Block a user