mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-02 22:00:34 +01:00
disable chart tooltips if mobile
This commit is contained in:
@@ -2,12 +2,17 @@
|
||||
/*global define, ajaxify, app, socket, RELATIVE_PATH*/
|
||||
|
||||
define('forum/admin/general/dashboard', ['semver'], function(semver) {
|
||||
var Admin = {};
|
||||
var updateIntervalId = 0;
|
||||
var Admin = {},
|
||||
updateIntervalId = 0,
|
||||
isMobile = false;
|
||||
|
||||
|
||||
Admin.init = function() {
|
||||
app.enterRoom('admin');
|
||||
socket.emit('meta.rooms.getAll', Admin.updateRoomUsage);
|
||||
|
||||
isMobile = !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
|
||||
if (updateIntervalId) {
|
||||
clearInterval(updateIntervalId);
|
||||
}
|
||||
@@ -195,6 +200,10 @@ define('forum/admin/general/dashboard', ['semver'], function(semver) {
|
||||
topicsCtx = topicsCanvas.getContext('2d'),
|
||||
trafficLabels = getHoursArray();
|
||||
|
||||
if (isMobile) {
|
||||
Chart.defaults.global.showTooltips = false;
|
||||
}
|
||||
|
||||
var data = {
|
||||
labels: trafficLabels,
|
||||
datasets: [
|
||||
|
||||
Reference in New Issue
Block a user