mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Code cleaning and function calls reorganization
This commit is contained in:
parent
b7badc7d32
commit
c2fd5322e2
@ -275,12 +275,13 @@ $.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /*
|
||||
},
|
||||
/**
|
||||
/* Flip navigator element
|
||||
* @param {Boolean} state - Flip state to set.
|
||||
*/
|
||||
setFlip: function() {
|
||||
this.viewport.toggleFlip();
|
||||
setFlip: function(state) {
|
||||
this.viewport.setFlip(state);
|
||||
|
||||
this.setDisplayTransform(this.viewer.viewport.flipped ? "scale(-1,1)" : "scale(1,1)");
|
||||
this.viewport.viewer.forceRedraw();
|
||||
this.setDisplayTransform(this.viewer.viewport.getFlip() ? "scale(-1,1)" : "scale(1,1)");
|
||||
return this;
|
||||
},
|
||||
|
||||
setDisplayTransform: function(rule) {
|
||||
|
@ -206,7 +206,7 @@
|
||||
* @property {Number} [degrees=0]
|
||||
* Initial rotation.
|
||||
*
|
||||
* @property {Boolean} [flip=false]
|
||||
* @property {Boolean} [flipped=false]
|
||||
* Initial flip state.
|
||||
*
|
||||
* @property {Number} [minZoomLevel=null]
|
||||
|
@ -1528,10 +1528,6 @@ $.Viewport.prototype = {
|
||||
*/
|
||||
toggleFlip: function() {
|
||||
this.setFlip(!this.getFlip());
|
||||
if(this.viewer.navigator){
|
||||
this.viewer.navigator.setFlip();
|
||||
}
|
||||
this.viewer.forceRedraw();
|
||||
return this;
|
||||
},
|
||||
|
||||
@ -1554,6 +1550,9 @@ $.Viewport.prototype = {
|
||||
*/
|
||||
setFlip: function( state ) {
|
||||
if ( this.flipped != state ) {
|
||||
this.flipped = state;
|
||||
this.viewer.forceRedraw();
|
||||
|
||||
/**
|
||||
* Raised when flip state has been changed.
|
||||
*
|
||||
@ -1565,9 +1564,14 @@ $.Viewport.prototype = {
|
||||
* @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||
*/
|
||||
this.viewer.raiseEvent('flip', {"flipped": state});
|
||||
} else {
|
||||
this.flipped = state;
|
||||
}
|
||||
|
||||
this.flipped = state;
|
||||
if(this.viewer.navigator){
|
||||
this.viewer.navigator.setFlip(this.getFlip());
|
||||
}
|
||||
this.viewer.forceRedraw();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user