File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ $ rake db:migrate
5353
54545 . Include where to show the heatmap:
5555``` erb
56- <%= show_heatmap(request.path) %>
56+ <%= show_heatmap %>
5757```
58586 . Before adding headmap.js in the application install ** jquery-rails** gem and require it in application.js file
5959``` js
@@ -68,14 +68,14 @@ $ rake db:migrate
6868## Viewing Heat Maps
6969Use the helper
7070``` erb
71- <%= show_heatmap(request.path) %>
71+ <%= show_heatmap %>
7272```
7373The argument is the path of current page. This way the helper will only display the respective heatmap.
7474The viewing can be done in multiple ways, for example if you want only the admin users to view heatmap, you can do something like:
7575
7676``` erb
7777<% if admin_user_signed_in? %>
78- <%= show_heatmap(request.path) %>
78+ <%= show_heatmap %>
7979<% end %>
8080```
8181
@@ -89,7 +89,7 @@ You can use:
8989
9090``` erb
9191<% if request.query_parameters.include?("see_heatmap") %>
92- <%= show_heatmap(request.path) %>
92+ <%= show_heatmap %>
9393<% end %>
9494```
9595
Original file line number Diff line number Diff line change @@ -240,11 +240,8 @@ def show_heatmap(type = false)
240240 heatmapInstance.addData(data_xpath);
241241 var scroll = JSON.parse('#{ raw ( @scroll_data . to_json . html_safe ) } ');
242242 var scroll_data = scroll.map(function(element){
243- var element = getElement(element.xpath);
244- if (!element)
245- return;
246- width = element.getBoundingClientRect().width;
247- height = element.getBoundingClientRect().height;
243+ width = getElement(element.xpath).getBoundingClientRect().width;
244+ height = getElement(element.xpath).getBoundingClientRect().height;
248245 dot = document.createElement('div');
249246 dot.className = "dot";
250247 dot.style.left = (getOffset(element.xpath).x+ (width * element.offset_x)) + "px";
Original file line number Diff line number Diff line change 11module Heatmap
22 module Rails
3- VERSION = "0.1.4 "
3+ VERSION = "0.2.0 "
44 end
55end
You can’t perform that action at this time.
0 commit comments