this.fluidbook.stats.track(14);
},
openIndex: function (title, group, closeAll, callback) {
- this.index.openIndex(title,group,closeAll,callback);
+ this.index.openIndex(title, group, closeAll, callback);
},
openArchives: function (title, callback) {
var archives = '<div class="caption">' + this.closeButton() + '<h2>' + title + '</h2></div>';
break;
case 'index':
fullscreen = true;
- $("#indexViewHolder").css('width', Math.floor(ww / 230) * 230);
+ if (this.fluidbook.mobilefirst.enabled) {
+ this.fluidbook.mobilefirst.resizeIndex();
+ } else {
+ $("#indexViewHolder").css('width', Math.floor(ww / 230) * 230);
+ }
break;
case 'share':
w = 200;
hm.on('pinchstart', function (event) {
console.log('pinchstart');
- if ($this.fluidbook.zoom.zoom == 1) {
+ if ($this.fluidbook.zoom.zoom === 1) {
$this.setZoomOriginFromEvent({'pageX': event.center.x, 'pageY': event.center.y});
}
$this.zoomAtPinchStart = $this.fluidbook.zoom.zoom;
hm.on('pinch', function (event) {
console.log('pinch');
- if ($this.zoomAtPinchStart != 0) {
+ if ($this.zoomAtPinchStart !== 0) {
$this.pinchZoom(event.scale, false);
event.preventDefault();
}
var hmf = new Hammer.Manager(document.getElementById('fluidbook'), options);
hmf.add(new Hammer.Pan({threshold: 0}));
hmf.on('panmove', function (event) {
- console.log('panmove');
if ($this.drag(event)) {
console.log('prevent scroll')
event.preventDefault();
}
});
hmf.on('panend', function (event) {
- console.log('panend');
var prevent = $this.drag(event, true);
$this.startX = $this.startY = -1;
$this.panX = $this.panY = 0;
},
pinchZoom: function (s, end) {
- if (s == 1) {
+ if (s === 1) {
return;
}
drag: function (e, end) {
- if (end == undefined) {
+ if (end === undefined) {
end = false;
}
if (this.fluidbook.zoom.zoom === 1) {
+ if (this.fluidbook.mobilefirst.enabled) {
+ return false;
+ }
if (this.startX === -1) {
this.startX = e.center.x;
}
this.panX = e.deltaX;
this.panY = e.deltaY;
- if (e.dx == 0 && e.dy == 0) {
+ if (e.dx === 0 && e.dy === 0) {
return;
}