}
this.contentlock = new FluidbookContentLock(this);
this.menu = new FluidbookMenu(this);
+ this.support = new FluidbookSupport(this);
this.zoom = new FluidbookZoom(this);
this.zoom.resetZoom();
this.cache = new FluidbookCache(datas);
this.service = new FluidbookService(this, datas.id);
- this.support = new FluidbookSupport(this);
this.loader = new FluidbookLoader(this);
this.search = new FluidbookSearch(this);
this.pad = new FluidbookPad(this);
this.originpx = ['0px', '0px'];
this.max = this.fluidbook.datas.zoomw / 100;
this.transition = true;
+ this.shadowTimeout;
this.hideInterfaceTimeout;
this.init();
}
});
// Detect when we have finished zooming out and raise an event
- $("#z").on('transitionend', function () {
- $this.triggerEvent((($this.zoom == 1) ? 'out' : 'in') + '.end');
+ $("#z").on(this.fluidbook.support.transitionEndEvent, function () {
+ $this.triggerEvent((($this.zoom === 1) ? 'out' : 'in') + '.end');
+ });
+
+ $(this.fluidbook).on('fluidbook.zoom.out.end,fluidbook.zoom.in.end', function () {
+ clearTimeout($this.shadowTimeout);
+ if ($this.zoom === 1) {
+ $("#shadow").removeClass('hidden');
+ } else {
+ $("#shadow").addClass('hidden');
+ }
});
},
}
}
if (this.zoom == zoom) {
-
return;
}
this.zoom = zoom;
resetZoom: function (callback) {
if (this.zoom === 1) {
- if(callback){
+ if (callback) {
callback();
}
return;
}
this.setZoom(1, -1);
- if(callback) {
+ if (callback) {
setTimeout(function () {
callback();
}, 350);
updateZoom: function () {
var $this = this;
+ clearTimeout(this.shadowTimeout);
if (this.zoom > 1) {
$("#z").removeClass('nozoom')
} else {
clearTimeout(this.hideInterfaceTimeout);
$(hiddenElements).show().removeClass('hidden');
- setTimeout(function () {
+ this.shadowTimeout = setTimeout(function () {
$("#shadow").removeClass('hidden');
}, 250);