}
});
$(document).on('click', '#links', function (e) {
- if ($this.fluidbook.input.isUsingMouse()) {
+ if ($this.fluidbook.zoom.enabled && $this.fluidbook.input.isUsingMouse()) {
$this.clickZoom(e);
return false;
}
e.stopPropagation();
})
- if (!this.fluidbook.mobilefirst.enabled) {
- $(document).on('mousewheel', function (e) {
- $this.wheelZoom(e.deltaY);
- });
- }
+ $(document).on('mousewheel', function (e) {
+ if ($this.fluidbook.zoom.enabled) {
+ $this.wheelZoom(e.deltaY);
+ }
+ });
$(document).on('mousemove', 'body', function (e) {
- $this.moveZoom(e);
+ if ($this.fluidbook.zoom.enabled) {
+ $this.moveZoom(e);
+ }
});
},
moveZoom: function (e, force) {
this.contentlock = new FluidbookContentLock(this);
this.menu = new FluidbookMenu(this);
this.support = new FluidbookSupport(this);
+ this.mobilefirst = new FluidbookMobileFirst(this);
this.zoom = new FluidbookZoom(this);
this.zoom.resetZoom();
this.cache = new FluidbookCache(datas);
this.loader = new FluidbookLoader(this);
this.search = new FluidbookSearch(this);
this.pad = new FluidbookPad(this);
- this.mobilefirst = new FluidbookMobileFirst(this);
this.scorm = new FluidbookScorm(this);
this.links = new FluidbookLinks(this);
this.waiters = [];
// Double tap
hm.on('doubletap', function (event) {
console.log('doubletap');
- if ($this.fluidbook.zoom.zoom > 1) {
- $this.fluidbook.zoom.setTransition(true);
- $this.fluidbook.zoom.resetZoom();
- } else {
- $this.setZoomOriginFromEvent(event.srcEvent);
- $this.fluidbook.zoom.setTransition(true);
- $this.fluidbook.zoom.setZoom($this.fluidbook.datas.zoom / 100, 1)
+ if ($this.fluidbook.zoom.enabled) {
+ if ($this.fluidbook.zoom.zoom > 1) {
+ $this.fluidbook.zoom.setTransition(true);
+ $this.fluidbook.zoom.resetZoom();
+ } else {
+ $this.setZoomOriginFromEvent(event.srcEvent);
+ $this.fluidbook.zoom.setTransition(true);
+ $this.fluidbook.zoom.setZoom($this.fluidbook.datas.zoom / 100, 1)
+ }
}
event.preventDefault();
});
- // Pinch
+ // Pinch
hm.on('pinchstart', function (event) {
- console.log('pinchstart');
- if ($this.fluidbook.zoom.zoom === 1) {
- $this.setZoomOriginFromEvent({'pageX': event.center.x, 'pageY': event.center.y});
+ if ($this.fluidbook.zoom.enabled) {
+ if ($this.fluidbook.zoom.zoom === 1) {
+ $this.setZoomOriginFromEvent({'pageX': event.center.x, 'pageY': event.center.y});
+ }
+ $this.zoomAtPinchStart = $this.fluidbook.zoom.zoom;
+ $this.pinchZoom(event.scale, false);
}
- $this.zoomAtPinchStart = $this.fluidbook.zoom.zoom;
- $this.pinchZoom(event.scale, false);
event.preventDefault();
});
hm.on('pinch', function (event) {
- console.log('pinch');
- if ($this.zoomAtPinchStart !== 0) {
- $this.pinchZoom(event.scale, false);
- event.preventDefault();
+ if ($this.fluidbook.zoom.enabled) {
+ console.log('pinch');
+ if ($this.zoomAtPinchStart !== 0) {
+ $this.pinchZoom(event.scale, false);
+ event.preventDefault();
+ }
}
});
hm.on('pinchend pinchcancel', function (event) {
- console.log('pinchend');
- $this.pinchZoom(event.scale, true);
- $this.zoomAtPinchStart = $this.fluidbook.zoom.zoom;
+ if ($this.fluidbook.zoom.enabled) {
+ console.log('pinchend');
+ $this.pinchZoom(event.scale, true);
+ $this.zoomAtPinchStart = $this.fluidbook.zoom.zoom;
+ }
event.preventDefault();
});
this.originpx = ['0px', '0px'];
this.max = this.fluidbook.datas.zoomw / 100;
this.transition = true;
+ this.enabled = true;
this.shadowTimeout;
this.hideInterfaceTimeout;
this.init();
FluidbookZoom.prototype = {
init: function () {
+ if (this.fluidbook.mobilefirst.enabled) {
+ this.disable();
+ return;
+ }
+
var $this = this;
this.setTransition(true);
},
+ disable: function () {
+ this.enabled = false;
+ $('body').addClass('zoom-disabled');
+ },
+
triggerEvent: function (event) {
var e = 'fluidbook.zoom.' + event;
$(this.fluidbook).trigger(e);