diff --git a/src/control.js b/src/control.js index 81af7819..36987b75 100644 --- a/src/control.js +++ b/src/control.js @@ -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;