loleaflet: don't reference our scrollbars

This commit is contained in:
Mihai Varga 2015-12-11 12:31:33 +02:00
parent 2d883a2dbe
commit 3f7de82ef9

View file

@ -133,13 +133,14 @@ L.CalcTileLayer = L.TileLayer.extend({
},
_onUpdateViewPort: function () {
var hscroll = L.DomUtil.get('mCSB_1_scrollbar_horizontal');
var width = parseInt(L.DomUtil.getStyle(hscroll, 'width'));
// sadly I don't know what this number 4 is, but without it, it does not work
// TODO fix it
var offset = 4;
var width = parseInt(L.DomUtil.getStyle(this._map._container, 'width')) - offset;
if (!isNaN(width)) {
this._columns.setViewPort(this._docPixelSize.x, width);
}
var vscroll = L.DomUtil.get('mCSB_1_scrollbar_vertical');
var height = parseInt(L.DomUtil.getStyle(vscroll, 'height'));
var height = parseInt(L.DomUtil.getStyle(this._map._container, 'height')) - offset;
if (!isNaN(height)) {
this._rows.setViewPort(this._docPixelSize.y, height);
}