Skip to content

Commit e123afa

Browse files
committed
heatmap resolution option lower limit check
1 parent ff98f71 commit e123afa

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

plugins/views/frontend/public/heatmap.js

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(function() {
22
var pageWidth = 0,
33
pageHeight = 0,
4-
currentDevice = Countly.passed_data.currentDevice && Countly.passed_data.currentDevice.length ? Countly.passed_data.currentDevice : [],
4+
currentDevice = Countly.passed_data.currentDevice && Countly.passed_data.currentDevice.length && Countly.passed_data.currentDevice[0] ? Countly.passed_data.currentDevice : [],
55
currentMap = Countly.passed_data.currentMap == "scroll" ? "scroll" : "click",
66
showHeatMap = Countly.passed_data.showHeatMap == false ? false : true,
77
clickMap,
@@ -31,10 +31,16 @@
3131
minWidth: 767,
3232
maxWidth: 1024
3333
},
34+
{
35+
type: "desktop-1280",
36+
displayText: "Desktop - 1280",
37+
minWidth: 1024,
38+
maxWidth: 1280
39+
},
3440
{
3541
type: "desktop-1366",
3642
displayText: "Desktop - 1366",
37-
minWidth: 1024,
43+
minWidth: 1280,
3844
maxWidth: 1366
3945
},
4046
{
@@ -89,15 +95,11 @@
8995
}
9096

9197
for (var i = 0; i < allDevices.length; i++) {
92-
if (allDevices[i].type == "all") {
93-
devices.push(allDevices[i]);
94-
}
95-
96-
if (allDevices[i].maxWidth <= pageWidth) {
98+
if ((allDevices[i].minWidth != null) && (allDevices[i].minWidth < pageWidth)) {
9799
devices.push(allDevices[i]);
98100
}
99101

100-
if (allDevices[i].type === "desktop-other") {
102+
if (allDevices[i].type === "desktop-other" && (devices.length > 3)) {
101103
devices.push(allDevices[i]);
102104
devices[devices.length - 1].minWidth = devices[devices.length - 2].maxWidth;
103105
}
@@ -776,4 +778,4 @@
776778
}
777779
}
778780
}
779-
})();
781+
})();

plugins/views/frontend/public/stylesheets/heatmap.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
}
220220

221221
#cly-heatmap-topbar .cly-heatmap-dropdown .cly-heatmap-menu .cly-heatmap-list {
222-
max-height: 300px;
222+
max-height: 350px;
223223
overflow: auto
224224
}
225225

0 commit comments

Comments
 (0)