this.setMouseClasses();
}
- if (Modernizr.ios || Modernizr.android) {
+ if (Modernizr.ios || Modernizr.android || this.fluidbook.settings.phonegap === 'ios' || this.fluidbook.settings.phonegap === 'android') {
this.usingTouch = this.hasTouch = this.forceTouch = true;
this.usingMouse = this.hasMouse = this.forceMouse = false;
this.usingKeyboard = this.hasKeyboard = this.forceKeyboard = false;
isUsingMouse: function () {
return this.usingMouse;
- },
- isUsingKeyboard: function () {
+ }, isUsingKeyboard: function () {
return this.usingKeyboard;
},
this.usingKeyboard = this.usingMouse = false;
this.setTouchClasses();
}
- },
- useMouse: function () {
+ }, useMouse: function () {
if (!this.usingMouse) {
this.hasMouse = this.usingMouse = true;
this.usingKeyboard = this.usingTouch = false;
this.setMouseClasses();
}
- },
- useKeyboard: function () {
+ }, useKeyboard: function () {
if (!this.usingKeyboard) {
this.hasKeyboard = this.usingKeyboard = true;
this.usingMouse = this.usingTouch = false;
.addClass('using-touch')
.addClass('no-using-keyboard');
- },
- setMouseClasses: function () {
+ }, setMouseClasses: function () {
$('html').addClass('using-mouse')
.addClass('no-using-touch')
.addClass('no-using-keyboard')
.removeClass('no-using-mouse')
.removeClass('using-touch')
.removeClass('using-keyboard');
- },
- setKeyboardClasses: function () {
+ }, setKeyboardClasses: function () {
$('html').addClass('using-keyboard')
.addClass('no-using-touch')
.addClass('no-using-mouse')
if (this.fluidbook.settings.phonegap === 'ios') {
$(document).on('touchstart touchend click', 'a.clickonly', function (e) {
- e.preventDefault();
- e.stopPropagation();
- e.stopImmediatePropagation();
+ var cancel = function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ e.stopImmediatePropagation();
+ };
if (e.type === 'touchstart') {
$(this).data('touchstart', Date.now());
+ cancel(e);
} else if (e.type === 'touchend') {
var start = $(this).data('touchstart');
if (start === null) {
- return;
+ cancel(e);
+ return false;
}
var diff = Date.now() - start;
if (diff > 300) {
- return;
+ cancel(e);
+ return false;
+ }
+ var href = $(this).attr('href');
+ if (href !== undefined && href !== null && href !== '' && href !== '#') {
+ cancel(e);
+ window.location = href;
+ return false;
}
- window.location = $(this).attr('href');
+ return true;
}
});
}
viewMode: function () {
return $("#view .mview").length > 0;
- }, openView: function (view, param1, param2, callback) {
+ },
+
+ openView: function (view, param1, param2, callback) {
var $this = this;
setTimeout(function () {
} else {
this.__openView(view, param1, param2, callback);
}
- }, __openView: function (view, param1, param2, callback) {
+ },
+
+ __openView: function (view, param1, param2, callback) {
try {
if (typeof param1 === 'string') {
} else {
this['open' + camelView](param1, param2, cb);
}
+
+ this.fluidbook.nav.closeMenu();
}, openNotes: function (p1, p2, cb) {
this.fluidbook.notes.openMenu(cb);
}, openSearch: function (q, cb) {
this.fluidbook.nav.openSearch(q, cb);
- }, openingView: function (callback, view) {
+ },
+
+ openingView: function (callback, view) {
var $this = this;
this.fluidbook.resize.resizeView();
this.fluidbook.tooltip.hideTooltip();