Chrome uses double for height/width of elements

This caused a NumberFormatExeption when trying to convert the string
representation of a double to an int.
Fixed by floor'ing the value.
This commit is contained in:
2018-04-14 10:08:55 +02:00
parent 23e16ff61d
commit 19a08558e3

View File

@@ -713,8 +713,8 @@ function sendPlotRequest(query){
var request = {}; var request = {};
request['query'] = query; request['query'] = query;
request['height'] = $('#result-image').height(); request['height'] = Math.floor($('#result-image').height());
request['width'] = $('#result-image').width(); request['width'] = Math.floor($('#result-image').width());
request['groupBy'] = groupBy(); request['groupBy'] = groupBy();
request['limitBy'] = data.searchBar.limitBy.selected; request['limitBy'] = data.searchBar.limitBy.selected;
request['limit'] = parseInt(data.searchBar.limitBy.number); request['limit'] = parseInt(data.searchBar.limitBy.number);
@@ -767,8 +767,8 @@ function updateImageLink(query) {
'plotType': data.searchBar.plotType, 'plotType': data.searchBar.plotType,
'aggregate': data.searchBar.aggregate, 'aggregate': data.searchBar.aggregate,
'keyOutside': data.searchBar.keyOutside, 'keyOutside': data.searchBar.keyOutside,
'width': $('#result-image').width(), 'width': Math.floor($('#result-image').width()),
'height': $('#result-image').height() 'height': Math.floor($('#result-image').height())
}; };
data.searchBar.imagelink = window.location.origin+ window.location.pathname + "plots?" + jQuery.param(params); data.searchBar.imagelink = window.location.origin+ window.location.pathname + "plots?" + jQuery.param(params);