Skip to content

Node.js based forum software built for the modern web

closes #1241

psychobunny0be363d22028
diff --git a/public/src/app.js b/public/src/app.js
index 23fb334953..03445d787f 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -175,18 +175,22 @@ app.cacheBuster = null;
app.createUserTooltips = function(els) {
els = els || $('body');
els.find('img[title].teaser-pic,img[title].user-img,div.user-icon,span.user-icon').each(function() {
- $(this).tooltip({
- placement: 'top',
- title: $(this).attr('title')
- });
+ if (!utils.isTouchDevice()) {
+ $(this).tooltip({
+ placement: 'top',
+ title: $(this).attr('title')
+ });
+ }
});
};
app.createStatusTooltips = function() {
- $('body').tooltip({
- selector:'.fa-circle.status',
- placement: 'top'
- });
+ if (!utils.isTouchDevice()) {
+ $('body').tooltip({
+ selector:'.fa-circle.status',
+ placement: 'top'
+ });
+ }
};
app.replaceSelfLinks = function(selector) {
@@ -332,21 +336,27 @@ app.cacheBuster = null;
return;
}
$('#header-menu li a[title]').each(function() {
- $(this).tooltip({
- placement: 'bottom',
- title: $(this).attr('title')
- });
+ if (!utils.isTouchDevice()) {
+ $(this).tooltip({
+ placement: 'bottom',
+ title: $(this).attr('title')
+ });
+ }
});
- $('#search-form').parent().tooltip({
- placement: 'bottom',
- title: $('#search-button i').attr('title')
- });
+ if (!utils.isTouchDevice()) {
+ $('#search-form').parent().tooltip({
+ placement: 'bottom',
+ title: $('#search-button i').attr('title')
+ });
+ }
- $('#user_dropdown').tooltip({
- placement: 'bottom',
- title: $('#user_dropdown').attr('title')
- });
+ if (!utils.isTouchDevice()) {
+ $('#user_dropdown').tooltip({
+ placement: 'bottom',
+ title: $('#user_dropdown').attr('title')
+ });
+ }
}
app.handleSearch = function () {
diff --git a/public/src/utils.js b/public/src/utils.js
index a2f8ea7a80..d214370d8a 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -237,6 +237,10 @@
return ((nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1) && !(nua.indexOf('Chrome') > -1));
},
+ isTouchDevice: function() {
+ return 'ontouchstart' in document.documentElement;
+ },
+
findBootstrapEnvironment: function() {
//http://stackoverflow.com/questions/14441456/how-to-detect-which-device-view-youre-on-using-twitter-bootstrap-api
var envs = ['xs', 'sm', 'md', 'lg'],