Documentation comments

This commit is contained in:
Nelson Campos 2018-04-12 10:36:34 +01:00
parent 84dc60632c
commit 194d1c0606

View File

@ -1522,7 +1522,9 @@ $.Viewport.prototype = {
},
/**
* Toggle flip state and demands a new drawing on navigator and viewer objects.
* Toggles flip state and demands a new drawing on navigator and viewer objects.
* @function
* @return {OpenSeadragon.Viewport} Chainable.
*/
toggleFlip: function() {
this.setFlip(!this.getFlip());
@ -1530,14 +1532,42 @@ $.Viewport.prototype = {
this.viewer.navigator.setFlip();
}
this.viewer.forceRedraw();
return this;
},
/**
* Gets flip state stored on viewport.
* @function
* @return {Boolean} Flip state.
*/
getFlip: function() {
return this.flipped;
},
/**
* Sets flip state according to the state input argument.
* @function
* @return {OpenSeadragon.Viewport} Chainable.
*/
setFlip: function( state ) {
if ( this.flipped != state ) {
/**
* Raised when flip state has been changed.
*
* @event flip
* @memberof OpenSeadragon.Viewer
* @type {object}
* @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.
* @property {Number} flipped - The flip state after this change.
* @property {?Object} userData - Arbitrary subscriber-defined object.
*/
this.viewer.raiseEvent('flip', {"flipped": state});
}
this.flipped = state;
return this;
}
};