From: Vincent Vanwaelscappel Date: Fri, 10 Sep 2021 17:06:45 +0000 (+0200) Subject: wait #4680 @4 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=093b0c885225c5c316b1a8e34bd2aaf9f9cb2ffa;p=fluidbook-html5.git wait #4680 @4 --- diff --git a/js/libs/aria/radio.js b/js/libs/aria/radio.js index 7b1968fa..97b3f13d 100644 --- a/js/libs/aria/radio.js +++ b/js/libs/aria/radio.js @@ -10,7 +10,7 @@ init: function () { var $this = this; - $(this.element).on('click', this.optionSelector, function () { + $(this.element).on(fluidbook.input.clickEvent, this.optionSelector, function () { if ($(this).hasClass('disabled')) { return true; } diff --git a/js/libs/fluidbook/cart/fluidbook.cart.flexipan.js b/js/libs/fluidbook/cart/fluidbook.cart.flexipan.js index 91c51849..e2d646a5 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.flexipan.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.flexipan.js @@ -10,7 +10,7 @@ FluidbookCartFlexipan.prototype = { init: function () { var $this = this; this.items = this.fluidbook.cache.get('cart', []); - $(document).on('click', '.exportCartPDF', function () { + $(document).on(this.fluidbook.input.clickEvent, '.exportCartPDF', function () { $this.exportPDF(); return false; }); diff --git a/js/libs/fluidbook/cart/fluidbook.cart.grandvision.js b/js/libs/fluidbook/cart/fluidbook.cart.grandvision.js index 5c8d5ca5..70d6cfff 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.grandvision.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.grandvision.js @@ -19,7 +19,7 @@ FluidbookCartGrandVision.prototype = { this.slotHTML = '
' + getSpriteIcon('grandvision-add') + '
'; - $(document).on('click', '.slots [data-cart-delete]', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '.slots [data-cart-delete]', function (e) { $(this).closest('.item,.text').replaceWith($this.slotHTML); $this.save(); $this.initRightSortable(); @@ -29,22 +29,22 @@ FluidbookCartGrandVision.prototype = { return false; }); - $(document).on('click', '.slot', function () { + $(document).on(this.fluidbook.input.clickEvent, '.slot', function () { $(this).replaceWith($this.getTextarea('')); return false; }); - $(document).on('click', '.grandvision-slideshow .next', function () { + $(document).on(this.fluidbook.input.clickEvent, '.grandvision-slideshow .next', function () { $this.nextSlide(); return false; }); - $(document).on('click', '.grandvision-slideshow .prev', function () { + $(document).on(this.fluidbook.input.clickEvent, '.grandvision-slideshow .prev', function () { $this.prevSlide(); return false; }); - $(document).on('click', '.grandvision-slideshow .dots a', function () { + $(document).on(this.fluidbook.input.clickEvent, '.grandvision-slideshow .dots a', function () { var diff = $(this).data('i') - $this.currentSlide; if (diff !== 0) { $this.gotoSlide($(this).data('i'), diff >= 1 ? 1 : -1); @@ -63,7 +63,7 @@ FluidbookCartGrandVision.prototype = { return true; }); - $(document).on('click', '[data-action="delete"]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-action="delete"]', function () { $.confirm({ backgroundDismiss: true, title: 'Remove box ?', @@ -84,12 +84,12 @@ FluidbookCartGrandVision.prototype = { return false; }); - $(document).on('click', '.addbox', function () { + $(document).on(this.fluidbook.input.clickEvent, '.addbox', function () { $this.addNewBox(); return false; }); - $(document).on('click', '[data-action="rename"]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-action="rename"]', function () { var h3 = $('.box>h3:eq(0)'); $.confirm({ title: 'Rename the box', @@ -127,12 +127,12 @@ FluidbookCartGrandVision.prototype = { return false; }); - $(document).on('click', '[data-action="export"]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-action="export"]', function () { $this.exportBoxes(); return false; }); - $(document).on('click', '[data-action="printbox"]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-action="printbox"]', function () { $this.exportBoxes(true); return false; }); diff --git a/js/libs/fluidbook/cart/fluidbook.cart.mif.js b/js/libs/fluidbook/cart/fluidbook.cart.mif.js index 0e8c69b5..4970c9e3 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.mif.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.mif.js @@ -10,11 +10,11 @@ FluidbookCartMIF.prototype = { init: function () { var $this = this; this.items = this.fluidbook.cache.get('cart', []); - $(document).on('click', '.exportCartPDF', function () { + $(document).on(this.fluidbook.input.clickEvent, '.exportCartPDF', function () { $this.exportPDF(); return false; }); - $(document).on('click', '.sendAsEmail', function () { + $(document).on(this.fluidbook.input.clickEvent, '.sendAsEmail', function () { try { $this.sendCartAsEmail(); } catch (err) { diff --git a/js/libs/fluidbook/cart/fluidbook.cart.mopec.js b/js/libs/fluidbook/cart/fluidbook.cart.mopec.js index 39f59e2d..e228490e 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.mopec.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.mopec.js @@ -56,13 +56,13 @@ FluidbookCartMopec.prototype = { return true; }); - $(document).on('click', '#zoomPopupMenu a.button.ext', function () { + $(document).on(this.fluidbook.input.clickEvent, '#zoomPopupMenu a.button.ext', function () { var ref = $(this).parent().find('[data-cart-ref]').data('cart-ref'); $this.fluidbook.stats._ga('event', 'Fluidbook', 'see_website', ref); return true; }); - $(document).on('click', 'a[href$="customer/account/login/"]', function () { + $(document).on(this.fluidbook.input.clickEvent, 'a[href$="customer/account/login/"]', function () { $this.fluidbook.stats._ga('event', 'Fluidbook', 'sign_in', $this.lastRefClicked); return true; }) diff --git a/js/libs/fluidbook/cart/fluidbook.cart.puma.js b/js/libs/fluidbook/cart/fluidbook.cart.puma.js index 26925ef8..b9863e78 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.puma.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.puma.js @@ -10,12 +10,12 @@ FluidbookCartPuma.prototype = { init: function () { var $this = this; this.items = this.fluidbook.cache.get('cart', []); - $(document).on('click', '.exportCartPDF', function () { + $(document).on(this.fluidbook.input.clickEvent, '.exportCartPDF', function () { $this.exportPDF(); return false; }); - $(document).on('click', '.exportCartXLS', function () { + $(document).on(this.fluidbook.input.clickEvent, '.exportCartXLS', function () { try { $this.exportXLS(); } catch (err) { @@ -24,7 +24,7 @@ FluidbookCartPuma.prototype = { return false; }); - $(document).on('click', '.emptyCart', function () { + $(document).on(this.fluidbook.input.clickEvent, '.emptyCart', function () { $.confirm({ backgroundDismiss: true, title: 'Empty my cart', diff --git a/js/libs/fluidbook/fluidbook.articles.js b/js/libs/fluidbook/fluidbook.articles.js index 2cfabe8e..f84d5270 100644 --- a/js/libs/fluidbook/fluidbook.articles.js +++ b/js/libs/fluidbook/fluidbook.articles.js @@ -15,7 +15,7 @@ FluidbookArticles.prototype = { $this.resize(); }); - $(document).on('click touchend', '.mview[data-menu="article"] .articlesPrint', function () { + $(document).on(this.fluidbook.input.clickEvent, '.mview[data-menu="article"] .articlesPrint', function () { var a = $(this).closest('article').attr('data-id'); var print_window = window.open('', 'print_article', 'height=400,width=600'); print_window.document.write($this.fluidbook.settings.articlesList[a].print); @@ -27,7 +27,7 @@ FluidbookArticles.prototype = { return false; }); - $(document).on('click touchend', '.mview[data-menu="article"] .articlesShare', function () { + $(document).on(this.fluidbook.input.clickEvent, '.mview[data-menu="article"] .articlesShare', function () { $(".mview").remove(); $this.fluidbook.menu.openView('share', 'article:' + $(this).attr('data-id'), 'article'); return false; diff --git a/js/libs/fluidbook/fluidbook.audiodescription.js b/js/libs/fluidbook/fluidbook.audiodescription.js index 3c954d07..4403a47e 100644 --- a/js/libs/fluidbook/fluidbook.audiodescription.js +++ b/js/libs/fluidbook/fluidbook.audiodescription.js @@ -51,7 +51,7 @@ FluidbookAudioDescription.prototype = { this.audioplayerRight.addEventListener('ended', this.endPlaying.bind(this, this.audioplayerRight)); // Handle click - $(document).on('click', '.' + this.buttonClass, function (e) { + $(document).on(this.fluidbook.input.clickEvent, '.' + this.buttonClass, function (e) { var player, button; diff --git a/js/libs/fluidbook/fluidbook.audioplayer.js b/js/libs/fluidbook/fluidbook.audioplayer.js index 50ffac77..ebb78e07 100644 --- a/js/libs/fluidbook/fluidbook.audioplayer.js +++ b/js/libs/fluidbook/fluidbook.audioplayer.js @@ -6,7 +6,7 @@ function FluidbookAudioPlayer(fluidbook) { FluidbookAudioPlayer.prototype = { init: function () { var $this = this; - $(document).on('click', "audio + .visualPlayer", function () { + $(document).on(this.fluidbook.input.clickEvent, "audio + .visualPlayer", function () { var audio = $(this).prev('audio').get(0); if (audio.paused) { audio.play(); diff --git a/js/libs/fluidbook/fluidbook.bookmarks.js b/js/libs/fluidbook/fluidbook.bookmarks.js index 8599e318..38214edd 100644 --- a/js/libs/fluidbook/fluidbook.bookmarks.js +++ b/js/libs/fluidbook/fluidbook.bookmarks.js @@ -26,13 +26,13 @@ function FluidbookBookmarks(fluidbook) { FluidbookBookmarks.prototype = { init: function () { var $this = this; - $(document).on('click touchend', '.bookmark', function () { + $(document).on(this.fluidbook.input.clickEvent, '.bookmark', function () { $this.toggleBookmark(parseInt($(this).attr('data-page'))); $this.fluidbook.tooltip.hideTooltip(); return false; }); - $(document).on('click', '.bookmarkssub a.send', function () { + $(document).on(this.fluidbook.input.clickEvent, '.bookmarkssub a.send', function () { var subject = '%title%'; if ($this.fluidbook.settings.bookmark_email_title !== '') { subject = $this.fluidbook.settings.bookmark_email_title; @@ -52,7 +52,7 @@ FluidbookBookmarks.prototype = { return false; }); - $(document).on('click', '.bookmarkssub a.download', function () { + $(document).on(this.fluidbook.input.clickEvent, '.bookmarkssub a.download', function () { $(this).data('ios-preview', '1'); if (!navigator.onLine && $this.fluidbook.settings.phonegap) { $this.fluidbook.alertInternetRequired(); diff --git a/js/libs/fluidbook/fluidbook.cart.js b/js/libs/fluidbook/fluidbook.cart.js index 356629b0..45852a29 100644 --- a/js/libs/fluidbook/fluidbook.cart.js +++ b/js/libs/fluidbook/fluidbook.cart.js @@ -16,7 +16,7 @@ FluidbookCart.prototype = { this.enabled = true; this.instance = this.createInstance(); - $(document).on('click', '[data-cart-delete]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-cart-delete]', function () { if ($(this).closest('.override-delete').length > 0) { return true; } @@ -25,7 +25,7 @@ FluidbookCart.prototype = { return false; }); - $(document).on('click', '[data-cart-ref]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-cart-ref]', function () { try { var qty = 1; if ($(this).data('cart-qty') !== null) { @@ -141,7 +141,7 @@ FluidbookCart.prototype = { this.wrapper.prepend('-'); this.wrapper.append('+'); - this.wrapper.on('click', 'a', function () { + this.wrapper.on(this.fluidbook.input.clickEvent, 'a', function () { if ($(this).hasClass('minus')) { $this.increment(-1 * $this.step); } else if ($(this).hasClass('plus')) { diff --git a/js/libs/fluidbook/fluidbook.help.js b/js/libs/fluidbook/fluidbook.help.js index efd47cf1..1472ac87 100644 --- a/js/libs/fluidbook/fluidbook.help.js +++ b/js/libs/fluidbook/fluidbook.help.js @@ -195,7 +195,7 @@ FluidbookHelp.prototype = { initEvents: function () { var $this = this; - $(document).on('click', '.icon-help', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '.icon-help', function (e) { $this.show(); if ($this.fluidbook.nav.menuIsOpen) { $this.fluidbook.nav.menuAPI.close(); @@ -275,7 +275,7 @@ FluidbookHelp.prototype = { $("body,#prev-arrows,#next-arrows").removeClass('help'); this.fluidbook.hideUnnecessaryButtons(); if (this.fluidbook.support.isMobile) { - $("*").unbind('click', function () { + $("*").unbind(this.fluidbook.input.clickEvent, function () { $this.hide(); }); } diff --git a/js/libs/fluidbook/fluidbook.input.js b/js/libs/fluidbook/fluidbook.input.js index b6a6ac62..720da7d3 100644 --- a/js/libs/fluidbook/fluidbook.input.js +++ b/js/libs/fluidbook/fluidbook.input.js @@ -9,12 +9,28 @@ function FluidbookInput(fluidbook) { this.hasKeyboard = false; this.usingKeyboard = false; this.forceKeyboard = false; + this.clickEvent = 'click'; + this.hoverEvent = 'mouseover'; this.init(); } FluidbookInput.prototype = { init: function () { var $this = this; + + this.hoverEvent = 'mouseover' + this.clickEvent = 'click'; + this.forceClickEvent = 'click'; + if (this.fluidbook.settings.phonegap === 'ios') { + // document.body.addEventListener("touchstart", function (e) { + // e.preventDefault(); + // e.stopPropagation(); + // }, false); + this.clickEvent = 'touchend'; + } else if (Modernizr.ftouch) { + this.clickEvent = 'click'; + } + if (Modernizr.ftouch) { this.hasTouch = true; } else { diff --git a/js/libs/fluidbook/fluidbook.interface.js b/js/libs/fluidbook/fluidbook.interface.js index bb3bc2b2..a9062011 100644 --- a/js/libs/fluidbook/fluidbook.interface.js +++ b/js/libs/fluidbook/fluidbook.interface.js @@ -40,7 +40,7 @@ FluidbookInterface.prototype = { } $('#interface').append(res); - $(document).on('click', '#next', function () { + $(document).on(this.fluidbook.input.clickEvent, '#next', function () { if ($this.fluidbook.help.isVisible()) { return false; } @@ -52,7 +52,7 @@ FluidbookInterface.prototype = { } return false; }); - $(document).on('click', '#previous', function () { + $(document).on(this.fluidbook.input.clickEvent, '#previous', function () { if ($this.fluidbook.help.isVisible()) { return; } @@ -64,7 +64,7 @@ FluidbookInterface.prototype = { } return false; }); - $(document).on('click', '#first', function () { + $(document).on(this.fluidbook.input.clickEvent, '#first', function () { if ($this.fluidbook.help.isVisible()) { return false; } @@ -72,7 +72,7 @@ FluidbookInterface.prototype = { $this.fluidbook.goFirstPage(); return false; }); - $(document).on('click', '#last', function () { + $(document).on(this.fluidbook.input.clickEvent, '#last', function () { if ($this.fluidbook.help.isVisible()) { return false; } @@ -155,7 +155,7 @@ FluidbookInterface.prototype = { return true; }); } else { - $(document).on('click', ':not(a)', function () { + $(document).on(this.fluidbook.input.clickEvent, ':not(a)', function () { var selector = '#fluidbook'; if (!$(this).is(selector) && $(this).closest(selector).length === 0) { return true; diff --git a/js/libs/fluidbook/fluidbook.landingpage.js b/js/libs/fluidbook/fluidbook.landingpage.js index 7ec58b7d..bcdaef42 100644 --- a/js/libs/fluidbook/fluidbook.landingpage.js +++ b/js/libs/fluidbook/fluidbook.landingpage.js @@ -35,7 +35,7 @@ FluidbookLandingPage.prototype = { // Click handler for all links inside iframe // We must wait for the iframe to load before we can add a listener to the document $('#landingPageIframe').on('load', function () { - $(this).contents().on('click', 'a', $this.handleLink); + $(this).contents().on(this.fluidbook.input.clickEvent, 'a', $this.handleLink); }); } }, diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index d5df0bf4..8f33421c 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -29,6 +29,29 @@ FluidbookLinks.prototype = { this.jumpToPageContainingLink = true; var $this = this; + + if (this.fluidbook.settings.phonegap === 'ios') { + $(document).on('touchstart touchend click', 'a.clickonly', function (e) { + e.preventDefault(); + e.stopPropagation(); + e.stopImmediatePropagation(); + + if (e.type === 'touchstart') { + $(this).data('touchstart', Date.now()); + } else if (e.type === 'touchend') { + var start = $(this).data('touchstart'); + if (start === null) { + return; + } + var diff = Date.now() - start; + if (diff > 300) { + return; + } + window.location = $(this).attr('href'); + } + }); + } + this.lowdef = this.fluidbook.support.android || this.fluidbook.support.iOS; $(this.fluidbook).on('fluidbook.page.change.end', function () { @@ -48,29 +71,29 @@ FluidbookLinks.prototype = { }); }); - $(document).on('click touchend', '[data-id] a', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-id] a', function () { var id = $(this).closest('[data-id]').attr('data-id'); $this.fluidbook.contentlock.addAction(id, 'click'); $this.fluidbook.gamify.linkClicked(id); return true; }); - $(document).on('click touchend', '.multimediaContainer[data-click-to-close="1"]', function () { + $(document).on(this.fluidbook.input.clickEvent, '.multimediaContainer[data-click-to-close="1"]', function () { $this.fluidbook.menu.closeView(); return false; }); - $(document).on('click', '[href^="#"]:not([href="#"])', function () { + $(document).on(this.fluidbook.input.clickEvent, '[href^="#"]:not([href="#"])', function () { location.hash = $(this).attr('href'); return false; }); - $(document).on('click', '[data-wescosales-ref]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-wescosales-ref]', function () { }); new ClipboardJS('[data-clipboard-text]'); - $(document).on('click', '[data-clipboard-text]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-clipboard-text]', function () { $this.fluidbook.tooltip.displayTooltip($this.fluidbook.l10n.__('copied!')); return true; }); @@ -93,7 +116,7 @@ FluidbookLinks.prototype = { }); - $(document).on('click', 'a, [data-pseudolink-href]', function () { + $(document).on(this.fluidbook.input.clickEvent, 'a, [data-pseudolink-href]', function () { if ($(this).is('#wopen')) { return true; } @@ -143,16 +166,17 @@ FluidbookLinks.prototype = { return false; }); + $(document).on('mouseover', '[data-showid][data-showmode="showonhover"]', function () { $this.showLinkById($(this).data('showid')); return true; }).on('mouseout', '[data-showid][data-showmode="showonhover"]', function () { $this.hideLinkById($(this).data('showid')); - }).on('click touchend', '[data-showid][data-showmode="showonhover"]', function () { + }).on(this.fluidbook.input.clickEvent, '[data-showid][data-showmode="showonhover"]', function () { return false; }); - $(document).on('click touchend', '[data-showid]:not([data-showmode="showonhover"])', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-showid]:not([data-showmode="showonhover"])', function () { var mode = $(this).data('showmode'); if (mode === 'toggle') { @@ -231,7 +255,7 @@ FluidbookLinks.prototype = { return false; }); - $(document).on('click touchend', '.linkshowclose', function () { + $(document).on(this.fluidbook.input.clickEvent, '.linkshowclose', function () { var id = $(this).closest('[data-id]').data('id'); $('div.link[data-id="' + id + '"]').each(function () { $this.hidePlacedLink(this); @@ -239,13 +263,13 @@ FluidbookLinks.prototype = { return false; }); - $(document).on('click touchend', '.textpopup', function () { + $(document).on(this.fluidbook.input.clickEvent, '.textpopup', function () { $this.fluidbook.menu.__openView('text', $(this).data('text'), function () { }); return false; }); - $(document).on('click touchend', 'a.triggerlink[data-trigger-event="click"]', function () { + $(document).on(this.fluidbook.input.clickEvent, 'a.triggerlink[data-trigger-event="click"]', function () { var ids = $(this).data('trigger-id').split(','); $.each(ids, function (k, id) { $this.triggerLinkById(id); @@ -253,7 +277,7 @@ FluidbookLinks.prototype = { return false; }); - $(document).on('click touchend', '[data-action]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-action]', function () { var map = {'pdf': 'print', 'fullScreen': "fullscreen", 'locales': 'localesContainers', 'basket': 'cart'}; var action = $(this).data('action'); var extra = $(this).data('extra'); diff --git a/js/libs/fluidbook/fluidbook.menu.js b/js/libs/fluidbook/fluidbook.menu.js index ef9852ae..11014150 100644 --- a/js/libs/fluidbook/fluidbook.menu.js +++ b/js/libs/fluidbook/fluidbook.menu.js @@ -11,7 +11,7 @@ FluidbookMenu.prototype = { // Note: iOS won't catch click events unless the element has a cursor:pointer style // This was added for #viewOverlay in the CSS // More details: https://stackoverflow.com/a/16006333 - $(document).on('click', ".mview .button.back, #viewOverlay", function (e) { + $(document).on(this.fluidbook.input.clickEvent, ".mview .button.back, #viewOverlay", function (e) { e.stopImmediatePropagation(); e.stopPropagation(); e.preventDefault(); diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index 17b1e6ca..13e2096c 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -89,13 +89,13 @@ FluidbookNav.prototype = { }); - $(document).on('click', '#menuOpener', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '#menuOpener', function (e) { e.preventDefault(); $this.menuAPI.open(); }); // Close menu when a search result is clicked - $(document).on('click', '#menuSearchResults a', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '#menuSearchResults a', function (e) { $this.menuAPI.close(); }); @@ -404,7 +404,7 @@ FluidbookNav.prototype = { } - $(link).on('click', function () { + $(link).on(this.fluidbook.input.clickEvent, function () { if (homeRequireLoader) { var $thislink = this; fluidbook.displayLoader(); @@ -714,7 +714,7 @@ FluidbookNav.prototype = { var $this = this; // Home icon - $(document).on('click', '.icon-home', function () { + $(document).on(this.fluidbook.input.clickEvent, '.icon-home', function () { var $this = this; fluidbook.displayLoader(); setTimeout(function () { @@ -724,13 +724,13 @@ FluidbookNav.prototype = { }); // Search icon in horizontal menu - $(document).on('click', '#horizontalNav_searchIcon', function (event) { + $(document).on(this.fluidbook.input.clickEvent, '#horizontalNav_searchIcon', function (event) { event.preventDefault() $this.openSearch(); }); // Share icon - $(document).on('click', '.icon-share', function () { + $(document).on(this.fluidbook.input.clickEvent, '.icon-share', function () { if ($this.fluidbook.settings.phonegap !== 'android') { return true; } @@ -739,7 +739,7 @@ FluidbookNav.prototype = { }); // Download icon - $(document).on('click', '.icon-download', function (event) { + $(document).on(this.fluidbook.input.clickEvent, '.icon-download', function (event) { event.preventDefault(); // Should we show complex PDF download options? Or just give them the full PDF? @@ -753,7 +753,7 @@ FluidbookNav.prototype = { }); // Print icon - $(document).on('click', '.icon-print', function () { + $(document).on(this.fluidbook.input.clickEvent, '.icon-print', function () { if (!$this.fluidbook.printing.advancedPrint()) { $this.fluidbook.print($(this)); return false; @@ -764,7 +764,7 @@ FluidbookNav.prototype = { }); // Bookmarks icon - $(document).on('click', '.icon-bookmarks', function () { + $(document).on(this.fluidbook.input.clickEvent, '.icon-bookmarks', function () { if ($(this).data('extra') !== null && $(this).data('extra') !== undefined) { $this.fluidbook.menu.openView('bookmark', $(this).data('extra'), null, function () { }); @@ -773,13 +773,13 @@ FluidbookNav.prototype = { }); // Zoom In icon - $(document).on('click', '.icon-zoomin', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '.icon-zoomin', function (e) { $this.fluidbook.desktop.clickZoom(e, 'in'); return false; }); // Zoom Out icon - $(document).on('click', '.icon-zoomout', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '.icon-zoomout', function (e) { $this.fluidbook.desktop.clickZoom(e, 'out'); return false; }); @@ -793,7 +793,7 @@ FluidbookNav.prototype = { var $this = this; // Full screen toggle - $(document).on('click', '.icon-fullscreen', function () { + $(document).on(this.fluidbook.input.clickEvent, '.icon-fullscreen', function () { $this.menuAPI.close(); screenfull.toggle(); return false; @@ -845,7 +845,7 @@ FluidbookNav.prototype = { buttonID = 'menuClose'; // Click handler to close menu - $(document).on('click', '#' + buttonID, function (e) { + $(document).on(this.fluidbook.input.clickEvent, '#' + buttonID, function (e) { e.preventDefault(); // If the search is active, the close button should clear the search @@ -883,7 +883,7 @@ FluidbookNav.prototype = { search.append(res); // Search submit button - $(document).on('click', '#submitSearch', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '#submitSearch', function (e) { $("#searchForm").submit(); e.preventDefault(); return false; @@ -909,7 +909,7 @@ FluidbookNav.prototype = { } }); - $(document).on('click', ".hint", function () { + $(document).on(this.fluidbook.input.clickEvent, ".hint", function () { var e = $("#q").val().split(' '); e.pop(); e.push($(this).attr('term')); diff --git a/js/libs/fluidbook/fluidbook.notes.js b/js/libs/fluidbook/fluidbook.notes.js index c7066568..c8c7a6d7 100644 --- a/js/libs/fluidbook/fluidbook.notes.js +++ b/js/libs/fluidbook/fluidbook.notes.js @@ -10,7 +10,7 @@ function FluidbookNotes(fluidbook) { FluidbookNotes.prototype = { init: function () { var $this = this; - $(document).on('click', '#horizontalNav_notes,[data-action="notes"]', function (event) { + $(document).on(this.fluidbook.input.clickEvent, '#horizontalNav_notes,[data-action="notes"]', function (event) { event.preventDefault() var rect = $(this).get(0).getBoundingClientRect(); @@ -19,11 +19,11 @@ FluidbookNotes.prototype = { left: -30 + rect.x + (rect.width / 2) }) }); - $(document).on('click', '#notes-add', function () { + $(document).on(this.fluidbook.input.clickEvent, '#notes-add', function () { $this.addNote(); return false; }); - $(document).on('click', '.note .remove', function () { + $(document).on(this.fluidbook.input.clickEvent, '.note .remove', function () { $this.removeNote($(this).closest('.note')); return false; }); @@ -45,7 +45,7 @@ FluidbookNotes.prototype = { }, 150); }); - $(document).on('click', '.notes-toggle', function () { + $(document).on(this.fluidbook.input.clickEvent, '.notes-toggle', function () { $this.toggleNotes(); return false; }); diff --git a/js/libs/fluidbook/fluidbook.pad.js b/js/libs/fluidbook/fluidbook.pad.js index 5d0aba9d..34a24514 100644 --- a/js/libs/fluidbook/fluidbook.pad.js +++ b/js/libs/fluidbook/fluidbook.pad.js @@ -14,7 +14,7 @@ FluidbookPad.prototype = { }, initEvents: function() { var $this = this; - $(document).on('click', '#down', function() { + $(document).on(this.fluidbook.input.clickEvent, '#down', function() { if ($this.fluidbook.help.isVisible()) { return; } diff --git a/js/libs/fluidbook/fluidbook.print.js b/js/libs/fluidbook/fluidbook.print.js index 652fe642..6352ad7b 100644 --- a/js/libs/fluidbook/fluidbook.print.js +++ b/js/libs/fluidbook/fluidbook.print.js @@ -9,7 +9,7 @@ FluidbookPrint.prototype = { var $this = this; // Handle click on Print/Download button inside dialogue - $(document).on('click', '#confirmChoice', function (event) { + $(document).on(this.fluidbook.input.clickEvent, '#confirmChoice', function (event) { event.preventDefault(); // ToDo: Consider what happens if Fluidbook is self-hosted or offline (maybe here is not the best place to handle that) @@ -65,7 +65,7 @@ FluidbookPrint.prototype = { }); // When there are no bookmarks a click on the bookmarks option will open the bookmarks help modal - $(document).on('click', '.bookmarks-option.disabled', function (event) { + $(document).on(this.fluidbook.input.clickEvent, '.bookmarks-option.disabled', function (event) { event.preventDefault(); $this.fluidbook.menu.quickCloseView(); diff --git a/js/libs/fluidbook/fluidbook.scorm.js b/js/libs/fluidbook/fluidbook.scorm.js index d3d2628e..553841e2 100644 --- a/js/libs/fluidbook/fluidbook.scorm.js +++ b/js/libs/fluidbook/fluidbook.scorm.js @@ -19,7 +19,7 @@ FluidbookScorm.prototype = { this.linksToComplete = this.fluidbook.settings.scorm_variables.linkstocomplete.split(','); } - $(document).on('click', 'a', function () { + $(document).on(this.fluidbook.input.clickEvent, 'a', function () { var link = $(this).closest('.link[data-id]'); if (link.length > 0) { var id = link.data('id'); diff --git a/js/libs/fluidbook/fluidbook.search.js b/js/libs/fluidbook/fluidbook.search.js index 1aed7e9b..62703256 100644 --- a/js/libs/fluidbook/fluidbook.search.js +++ b/js/libs/fluidbook/fluidbook.search.js @@ -80,26 +80,26 @@ FluidbookSearch.prototype = { this.resultsNav = $('#' + this.resultsNavID); //=== Event handlers - $(document).on('click', '#menuSearchResults a', function () { + $(document).on(this.fluidbook.input.clickEvent, '#menuSearchResults a', function () { // Find the page number of the result so we can see where it sits in the list of returned results var pageNumber = parseInt($(this).parents('.doubleThumb').attr('page')); $this.openResultsNav(pageNumber); }); - $(document).on('click', '.searchResultsNavField', function () { + $(document).on(this.fluidbook.input.clickEvent, '.searchResultsNavField', function () { $this.closeResultsNav(true); $this.fluidbook.nav.openSearch(); }); - $(document).on('click', '.searchResultsNext', function () { + $(document).on(this.fluidbook.input.clickEvent, '.searchResultsNext', function () { $this.nextResultsPage(); }); - $(document).on('click', '.searchResultsPrev', function () { + $(document).on(this.fluidbook.input.clickEvent, '.searchResultsPrev', function () { $this.previousResultsPage(); }); - $(document).on('click', '.searchResultsNavClose', function () { + $(document).on(this.fluidbook.input.clickEvent, '.searchResultsNavClose', function () { $this.closeResultsNav(); }); diff --git a/js/libs/fluidbook/fluidbook.share.js b/js/libs/fluidbook/fluidbook.share.js index 547221e9..7555ace5 100644 --- a/js/libs/fluidbook/fluidbook.share.js +++ b/js/libs/fluidbook/fluidbook.share.js @@ -3,7 +3,7 @@ function FluidbookShare(fluidbook) { if (this.isEnabled()) { var $this = this; if (this.fluidbook.settings.phonegap !== 'android') { - $(document).on('click', '.share', function () { + $(document).on(this.fluidbook.input.clickEvent, '.share', function () { var f = 'send' + ucfirst($(this).data('service')); var url = $(this).data("url"); if (url === undefined || url === null || url === 'undefined') { @@ -17,7 +17,7 @@ function FluidbookShare(fluidbook) { }); } - $(document).on('click touchend', '[data-action="share"]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-action="share"]', function () { $this.fluidbook.menu.openView("share", $(this).data('extra'), $(this).data('context')); return false; }); @@ -38,7 +38,7 @@ function FluidbookShare(fluidbook) { }); if (this.fluidbook.settings.phonegap === 'android') { - $(document).on('click', '#shareLinks, #shareLinks a', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '#shareLinks, #shareLinks a', function (e) { e.stopPropagation(); e.stopImmediatePropagation(); e.preventDefault(); diff --git a/js/libs/fluidbook/fluidbook.slider.js b/js/libs/fluidbook/fluidbook.slider.js index a6f54b79..d88a2e98 100644 --- a/js/libs/fluidbook/fluidbook.slider.js +++ b/js/libs/fluidbook/fluidbook.slider.js @@ -10,11 +10,11 @@ function FluidbookSlider(fluidbook) { FluidbookSlider.prototype = { init: function () { var $this = this; - $(document).on('click', function () { + $(document).on(this.fluidbook.input.clickEvent, function () { $("#slider").removeClass('drag'); return true; }); - $(document).on('click', '#sliderthumb a[data-page]', function () { + $(document).on(this.fluidbook.input.clickEvent, '#sliderthumb a[data-page]', function () { if ($this.fluidbook.canChangePage()) { $this.fluidbook.setCurrentPage(parseInt($(this).attr('data-page'))); } @@ -27,7 +27,7 @@ FluidbookSlider.prototype = { $this.updateCursorPosition(); }); - $("#sliderback").on('click', function (e) { + $("#sliderback").on(this.fluidbook.input.clickEvent, function (e) { if ($this.fluidbook.pagetransitions.transitionning) { return; } diff --git a/js/libs/fluidbook/fluidbook.sound.js b/js/libs/fluidbook/fluidbook.sound.js index f84e1d20..8456515a 100644 --- a/js/libs/fluidbook/fluidbook.sound.js +++ b/js/libs/fluidbook/fluidbook.sound.js @@ -23,7 +23,7 @@ FluidbookSound.prototype = { $(this.fluidbook).on('fluidbook.ready', function () { $this.init(); }); - $(document).on('click touchend', '.icon-sound-off,.icon-sound-on', function () { + $(document).on(this.fluidbook.input.clickEvent, '.icon-sound-off,.icon-sound-on', function () { $this.toggle(); return false; }); @@ -32,7 +32,7 @@ FluidbookSound.prototype = { $this.playSoundForPage(data); }); - $(document).one('click', '*', function () { + $(document).one(this.fluidbook.input.clickEvent, '*', function () { try { $this.audios['empty'].play(); $this.playing = $this.audios['empty']; diff --git a/js/libs/fluidbook/fluidbook.stats.js b/js/libs/fluidbook/fluidbook.stats.js index d5f6c623..d1f243d7 100644 --- a/js/libs/fluidbook/fluidbook.stats.js +++ b/js/libs/fluidbook/fluidbook.stats.js @@ -45,7 +45,7 @@ function FluidbookStats(fluidbook) { FluidbookStats.prototype = { init: function () { var $this = this; - $(document).on('click', 'a[data-track]', function () { + $(document).on(this.fluidbook.input.clickEvent, 'a[data-track]', function () { $this.track(6, 0, $(this).attr('data-track')); return true; }); diff --git a/js/libs/fluidbook/fluidbook.tooltip.js b/js/libs/fluidbook/fluidbook.tooltip.js index 50bdba0d..d2042c04 100644 --- a/js/libs/fluidbook/fluidbook.tooltip.js +++ b/js/libs/fluidbook/fluidbook.tooltip.js @@ -24,7 +24,7 @@ FluidbookTooltip.prototype = { }); - $(document).on('mouseover', 'a[data-tooltip]', function (e) { + $(document).on(this.fluidbook.input.hoverEvent, 'a[data-tooltip]', function (e) { $this.type = 'mouse'; $this.updateMousePosition(e); $this.eventTriggered(this); @@ -40,7 +40,7 @@ FluidbookTooltip.prototype = { $(document).on('blur', 'a[data-tooltip],a[data-keyboard-tooltip]', function (e) { $this.hideTooltip(); }); - $(document).on('click', '[data-tooltip-hide-on-click]', function () { + $(document).on(this.fluidbook.input.clickEvent, '[data-tooltip-hide-on-click]', function () { $this.hideTooltip(); }); @@ -212,7 +212,7 @@ FluidbookTooltip.prototype = { showFixedTooltip: function (e, posX, posY, css) { this.hideTooltip(); $(e).attr('data-pos-x', posX).attr('data-pos-y', posY).css(css).show(); - $(document).one('click', '*', function () { + $(document).one(this.fluidbook.input.clickEvent, '*', function () { $(e).hide(); }); }, diff --git a/js/libs/fluidbook/fluidbook.widget.js b/js/libs/fluidbook/fluidbook.widget.js index 2b7e34a1..f1c6bf59 100644 --- a/js/libs/fluidbook/fluidbook.widget.js +++ b/js/libs/fluidbook/fluidbook.widget.js @@ -25,7 +25,7 @@ FluidbookWidget.prototype = { $this.update(); }); - $("#fluidbook").on('click', function () { + $("#fluidbook").on(this.fluidbook.input.clickEvent, function () { return $this.click(); }); this.update(true); diff --git a/js/libs/fluidbook/forms/fluidbook.form.avery.js b/js/libs/fluidbook/forms/fluidbook.form.avery.js index 2650c3d1..126685bc 100644 --- a/js/libs/fluidbook/forms/fluidbook.form.avery.js +++ b/js/libs/fluidbook/forms/fluidbook.form.avery.js @@ -55,7 +55,7 @@ FluidbookAveryForm.prototype = { init: function () { var $this = this; - $(document).on('click', '.mview[data-form="avery"] a.submit', function () { + $(document).on(this.fluidbook.input.clickEvent, '.mview[data-form="avery"] a.submit', function () { $this.formInstance = $(".avery-form").parsley(); if ($this.formInstance.validate()) { $this.submitForm(); @@ -65,7 +65,7 @@ FluidbookAveryForm.prototype = { return false; }); - $(document).on('click', '.mview[data-form="avery"] a.close-avery', function () { + $(document).on(this.fluidbook.input.clickEvent, '.mview[data-form="avery"] a.close-avery', function () { Cookies.set('form', '0', {expires: 365}); return false; }); diff --git a/js/libs/fluidbook/forms/fluidbook.form.bourbon.js b/js/libs/fluidbook/forms/fluidbook.form.bourbon.js index 30f6cf5d..f1db119c 100644 --- a/js/libs/fluidbook/forms/fluidbook.form.bourbon.js +++ b/js/libs/fluidbook/forms/fluidbook.form.bourbon.js @@ -10,7 +10,7 @@ FluidbookBourbonForm.prototype = { this.fluidbook.menu.openSuggest = this.openSuggest; - $(document).on('click', '.cart-bourbon-suggest .submit', function () { + $(document).on(this.fluidbook.input.clickEvent, '.cart-bourbon-suggest .submit', function () { $this.formInstance = $(".cart-bourbon-suggest").parsley(); if ($this.formInstance.validate()) { $this.sendSuggestion(); diff --git a/js/libs/fluidbook/links/fluidbook.links.zoom.js b/js/libs/fluidbook/links/fluidbook.links.zoom.js index 64997460..f40a4606 100644 --- a/js/libs/fluidbook/links/fluidbook.links.zoom.js +++ b/js/libs/fluidbook/links/fluidbook.links.zoom.js @@ -11,7 +11,7 @@ FluidbookLinksZoom.prototype = { // ToDo: consider re-using existing popinOverlay div? $('body').append('
'); - $(document).on('click', '.zoomPopup', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '.zoomPopup', function (e) { e.preventDefault(); $this.zoomLink(this); return false; @@ -26,7 +26,7 @@ FluidbookLinksZoom.prototype = { $this.zoomLinkReset(true); }); - $(document).on('click', '#zoomPopupOverlay, .zoomPopupWrapper, .zoomPopupClose, #zoomPopupBackground .bg', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '#zoomPopupOverlay, .zoomPopupWrapper, .zoomPopupClose, #zoomPopupBackground .bg', function (e) { $this.zoomLinkReset(); return false; }); diff --git a/js/libs/fluidbook/links/fluidbook.links.zoomhd.js b/js/libs/fluidbook/links/fluidbook.links.zoomhd.js index 1cd7a7ce..c42a0b84 100644 --- a/js/libs/fluidbook/links/fluidbook.links.zoomhd.js +++ b/js/libs/fluidbook/links/fluidbook.links.zoomhd.js @@ -44,7 +44,7 @@ FluidbookLinksZoomHD.prototype = { } }); - $(document).on('click', '.zoomhdControls a', function () { + $(document).on(this.fluidbook.input.clickEvent, '.zoomhdControls a', function () { var s = $this.scale; if ($(this).hasClass('minus')) { s -= 0.5; diff --git a/js/libs/fluidbook/menu/fluidbook.chapters.js b/js/libs/fluidbook/menu/fluidbook.chapters.js index 2ceb747f..c4af374c 100644 --- a/js/libs/fluidbook/menu/fluidbook.chapters.js +++ b/js/libs/fluidbook/menu/fluidbook.chapters.js @@ -54,7 +54,7 @@ FluidbookChapters.prototype = { initCascadeEvents: function () { this.cascadeEventsInited = true; if (this.style == 'ina') { - $(document).on('click', 'ul.chapters a .right', function (e) { + $(document).on(this.fluidbook.input.forceClickEvent, 'ul.chapters a .right', function (e) { var p = $(this).data('page'); if (p != '') { $this.fluidbook.setCurrentPage(p); @@ -66,7 +66,7 @@ FluidbookChapters.prototype = { }); } - $(document).on('click', 'ul.chapters a', function () { + $(document).on(this.fluidbook.input.forceClickEvent, 'ul.chapters a', function () { var li = $(this).parent(); var subnav = $(li).children('ul'); if ($(subnav).length) { @@ -219,9 +219,9 @@ FluidbookChapters.prototype = { href = this.cascade ? 'href="#"' : "nohref"; } if (this.style == 'classic') { - res += '
  • '; + res += '
  • '; } else if (this.style == 'ina') { - res += '
  • '; + res += '
  • '; } res += '' + chapter.label + ''; if (href != 'nohref') { diff --git a/js/libs/fluidbook/menu/fluidbook.index.js b/js/libs/fluidbook/menu/fluidbook.index.js index 3cbfc9d9..6faeabc0 100644 --- a/js/libs/fluidbook/menu/fluidbook.index.js +++ b/js/libs/fluidbook/menu/fluidbook.index.js @@ -200,7 +200,7 @@ FluidbookIndex.prototype = { } var res = '
    '; if (link) { - res += ''; + res += ''; } res += this.fluidbook.loader.getThumbImage(page, true, dim.thumb); if (link) { diff --git a/js/libs/fluidbook/slideshow/fluidbook.slideshow.vacheron.js b/js/libs/fluidbook/slideshow/fluidbook.slideshow.vacheron.js index 14bb1443..5d202ce7 100644 --- a/js/libs/fluidbook/slideshow/fluidbook.slideshow.vacheron.js +++ b/js/libs/fluidbook/slideshow/fluidbook.slideshow.vacheron.js @@ -7,17 +7,17 @@ FluidbookVacheronSlideshow.prototype = { initEvents: function () { var $this = this; - $(document).on('click', '.fb-slideshow-wrapper.vacheron .fb-slideshow-nav-next', function () { + $(document).on(this.fluidbook.input.clickEvent, '.fb-slideshow-wrapper.vacheron .fb-slideshow-nav-next', function () { $this.gotoNextIndex($(this).closest('.fb-slideshow')); return false; }); - $(document).on('click', '.fb-slideshow-wrapper.vacheron .fb-slideshow-nav-prev', function () { + $(document).on(this.fluidbook.input.clickEvent, '.fb-slideshow-wrapper.vacheron .fb-slideshow-nav-prev', function () { $this.gotoPrevIndex($(this).closest('.fb-slideshow')); return false; }); - $(document).on('click', '.fb-slideshow-wrapper.vacheron .fb-slideshow-nav-index', function () { + $(document).on(this.fluidbook.input.clickEvent, '.fb-slideshow-wrapper.vacheron .fb-slideshow-nav-index', function () { $this.gotoIndex($(this).data('index'), $(this).closest('.fb-slideshow')); return false; }); diff --git a/js/libs/fluidbook/special/atlanticdownload.js b/js/libs/fluidbook/special/atlanticdownload.js index f9cf9e17..7c8df02f 100644 --- a/js/libs/fluidbook/special/atlanticdownload.js +++ b/js/libs/fluidbook/special/atlanticdownload.js @@ -8,18 +8,18 @@ var AtlanticDL = { init: function () { var self = AtlanticDL; - $(document).on('click', '[data-atlanticdownload-ref]', function (e) { + $(document).on(this.fluidbook.input.clickEvent, '[data-atlanticdownload-ref]', function (e) { self.filterData($(this).data('atlanticdownload-ref')); self.openPopup(); return false; }); - $(document).on('click touchend', '#' + self.popupID + ' .close', function () { + $(document).on(fluidbook.input.clickEvent, '#' + self.popupID + ' .close', function () { $(this).closest('#' + self.popupID).remove(); return false; }); - $(document).on('click', '.language-link', function () { + $(document).on(this.fluidbook.input.clickEvent, '.language-link', function () { self.currentLanguage = $(this).data('language'); $('#AtlanticDownloads').html(self.generateRows()); @@ -27,7 +27,7 @@ var AtlanticDL = { return false; }); - $(document).on('click', '.atlantic-download-icon', function () { + $(document).on(this.fluidbook.input.clickEvent, '.atlantic-download-icon', function () { fluidbook.stats._ga('event', 'documentdownload', 'file', $(this).attr('href')); return true; }); diff --git a/js/libs/fluidbook/special/mirakleaster2021.js b/js/libs/fluidbook/special/mirakleaster2021.js index dcb55848..6115465b 100644 --- a/js/libs/fluidbook/special/mirakleaster2021.js +++ b/js/libs/fluidbook/special/mirakleaster2021.js @@ -1,7 +1,7 @@ var MiraklEaster2021 = { init: function () { var $this = this; - $(document).on('click', '[data-answers]', function () { + $(document).on(fluidbook.input.clickEvent, '[data-answers]', function () { var answers = $(this).data('answers').toString().toLowerCase().trim().split(';'); $.confirm({ escapeKey: true, diff --git a/js/libs/fluidbook/special/wescosales.js b/js/libs/fluidbook/special/wescosales.js index 12ff511f..72b86ba8 100644 --- a/js/libs/fluidbook/special/wescosales.js +++ b/js/libs/fluidbook/special/wescosales.js @@ -38,12 +38,12 @@ function initWescoNav() { function initWesco() { fluidbook.search.registerPlugin(new WescoSalesSearchPlugin()); - $(document).on('click', '[data-wescosales-ref]', function (e) { + $(document).on(fluidbook.input.clickEvent, '[data-wescosales-ref]', function (e) { setWescoSalesPanel($(this).data('wescosales-ref'), e); return false; }); - $(document).on('click touchend', '.wescosaleswindow .close', function () { + $(document).on(fluidbook.input.clickEvent, '.wescosaleswindow .close', function () { $(this).closest('.wescosaleswindow').remove(); return false; }); diff --git a/js/main.js b/js/main.js index 58e25d16..01b0172a 100644 --- a/js/main.js +++ b/js/main.js @@ -37,6 +37,7 @@ try { INITED = false; if (SETTINGS && SETTINGS.phonegap) { + $('body').addClass('cordova').addClass('cordova-' + SETTINGS.phonegap); loadPhonegap(); } else { setTimeout(function () { @@ -310,12 +311,12 @@ try { } }); - $(document).on('click', "#popinOverlay", function () { + $(document).on(fluidbook.input.clickEvent, "#popinOverlay", function () { closePopin(); return false; }); - $(document).on('click', 'a.popin', function () { + $(document).on(fluidbook.input.clickEvent, 'a.popin', function () { var iframeid = 'iframe_' + Math.round(Math.random() * 100000); var html = '
    '; @@ -343,7 +344,7 @@ try { return false; }); - $(document).on('click', 'a.appswitchlocale', function () { + $(document).on(this.fluidbook.input.clickEvent, 'a.appswitchlocale', function () { try { fluidbook.displayLoader(); if ($(".mview").length > 0) { @@ -377,7 +378,7 @@ try { $("#logo").click(clickLogo); - $(document).on('click', '.lazy', function () { + $(document).on(this.fluidbook.input.clickEvent, '.lazy', function () { return false; }); diff --git a/style/fluidbook.less b/style/fluidbook.less index a7d6e183..3db3466e 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -88,6 +88,10 @@ a { -webkit-font-smoothing: antialiased; } +body.cordova-ios * { + -webkit-user-select: none; +} + img { border: 0; box-sizing: content-box; @@ -3065,7 +3069,7 @@ body > input { opacity: 0; pointer-events: none; position: absolute; - top:-20000px; + top: -20000px; } @import "mobilefirst.less";