ImageViewer: show overview only when needed

This commit is contained in:
rolux 2014-01-17 13:31:51 +00:00
parent bd46effadf
commit c29e0c0eaf

View file

@ -500,7 +500,7 @@ Ox.ImageViewer = function(options, self) {
self.$image.css(getImageCSS()); self.$image.css(getImageCSS());
self.$overlay.css(getOverlayCSS()); self.$overlay.css(getOverlayCSS());
} }
updateButtons(); updateInterface();
showInterface(); showInterface();
hideInterface(); hideInterface();
} }
@ -536,7 +536,7 @@ Ox.ImageViewer = function(options, self) {
} }
} }
function updateButtons() { function updateInterface() {
self.$scaleButton[ self.$scaleButton[
self.zoom == self.fitZoom ? 'disableButton' : 'enableButton' self.zoom == self.fitZoom ? 'disableButton' : 'enableButton'
]('fit'); ]('fit');
@ -555,6 +555,9 @@ Ox.ImageViewer = function(options, self) {
self.$zoomButton[ self.$zoomButton[
self.zoom == self.maxZoom ? 'disableButton' : 'enableButton' self.zoom == self.maxZoom ? 'disableButton' : 'enableButton'
]('in'); ]('in');
self.$overview[
self.zoom == self.fitZoom ? 'hide' : 'show'
]();
} }
function updateSize() { function updateSize() {