update area via options

This commit is contained in:
j 2018-03-06 18:16:21 +05:30
parent e67ec495d2
commit 819c5c747d

View file

@ -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);
},