From 9dc442056182b3a4b0c9010e12596582d022f51a Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sat, 28 May 2016 13:07:24 +0200 Subject: [PATCH] frio: open hovercard on click if device is a mobile device --- view/theme/frio/js/hovercard.js | 18 +++++++++++++++--- view/theme/frio/theme.php | 11 +++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/view/theme/frio/js/hovercard.js b/view/theme/frio/js/hovercard.js index 93c87e7a88..a0def61eb5 100644 --- a/view/theme/frio/js/hovercard.js +++ b/view/theme/frio/js/hovercard.js @@ -47,6 +47,14 @@ $(document).ready(function(){ var title = targetElement.attr("title"); targetElement.attr({"data-orig-title": title, title: ""}); + // if the device is a mobile open the hover card by click and not by hover + if(typeof is_mobile != "undefined") { + targetElement[0].removeAttribute("href"); + var hctrigger = 'click'; + } else { + var hctrigger = 'manual'; + }; + // Timeoute until the hover-card does appear setTimeout(function(){ if(targetElement.is(":hover") && parseInt(targetElement.attr('data-awaiting-hover-card'),10) == timeNow) { @@ -69,7 +77,7 @@ $(document).ready(function(){ } return "top"; }, - trigger: 'manual', + trigger: hctrigger, template: '