Replaced mobileBrowser() with a better test

This commit is contained in:
Tobias Reich 2015-01-29 23:07:38 +01:00
parent 206f3ba28d
commit b27ccbe349
4 changed files with 5 additions and 7 deletions

View File

@ -6,7 +6,7 @@
$(document).ready(function() {
/* Event Name */
var eventName = (mobileBrowser()) ? 'touchend' : 'click';
var eventName = ('ontouchend' in document.documentElement) ? 'touchend' : 'click';
/* Multiselect */
$('#content') .on('mousedown', function(e) { if (e.which===1) multiselect.show(e) });
@ -125,7 +125,7 @@ $(document).ready(function() {
});
if (mobileBrowser()) {
if ('ontouchend' in document.documentElement) {
$(document)

View File

@ -16,7 +16,6 @@ multiselect.position = {
multiselect.show = function(e) {
if (mobileBrowser()) return false;
if (lychee.publicMode) return false;
if (visible.search()) return false;
if (visible.infobox()) return false;
@ -40,7 +39,6 @@ multiselect.selectAll = function() {
newWidth,
newHeight;
if (mobileBrowser()) return false;
if (lychee.publicMode) return false;
if (visible.search()) return false;
if (visible.infobox()) return false;

View File

@ -61,7 +61,7 @@ photo.preloadNext = function(photoID) {
// Never preload on mobile devices with bare RAM and
// mostly mobile internet
if (mobileBrowser()) return false;
// {{ code }}
if (album.json &&
album.json.content &&

View File

@ -12,7 +12,7 @@ var header = $('header'),
$(document).ready(function(){
/* Event Name */
if (mobileBrowser()) event_name = 'touchend';
if ('ontouchend' in document.documentElement) event_name = 'touchend';
else event_name = 'click';
/* Window */