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 || {}) .options(options || {})
.update({ .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() { center: function() {
setCenterAndZoom(true, true); setCenterAndZoom(true, true);
}, },