update area via options
This commit is contained in:
parent
e67ec495d2
commit
819c5c747d
1 changed files with 8 additions and 0 deletions
|
@ -43,6 +43,14 @@ Ox.ImageViewer = function(options, self) {
|
|||
})
|
||||
.options(options || {})
|
||||
.update({
|
||||
area: function() {
|
||||
if (self.options.area && self.options.area.length == 4) {
|
||||
var centerAndZoom = getCenterAndZoom(self.options.area);
|
||||
self.options.center = centerAndZoom.center;
|
||||
self.options.zoom = centerAndZoom.zoom;
|
||||
setCenterAndZoom(true, true);
|
||||
}
|
||||
},
|
||||
center: function() {
|
||||
setCenterAndZoom(true, true);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue