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 () { _onUpdateViewPort: function () {
var hscroll = L.DomUtil.get('mCSB_1_scrollbar_horizontal'); // sadly I don't know what this number 4 is, but without it, it does not work
var width = parseInt(L.DomUtil.getStyle(hscroll, 'width')); // TODO fix it
var offset = 4;
var width = parseInt(L.DomUtil.getStyle(this._map._container, 'width')) - offset;
if (!isNaN(width)) { if (!isNaN(width)) {
this._columns.setViewPort(this._docPixelSize.x, width); this._columns.setViewPort(this._docPixelSize.x, width);
} }
var vscroll = L.DomUtil.get('mCSB_1_scrollbar_vertical'); var height = parseInt(L.DomUtil.getStyle(this._map._container, 'height')) - offset;
var height = parseInt(L.DomUtil.getStyle(vscroll, 'height'));
if (!isNaN(height)) { if (!isNaN(height)) {
this._rows.setViewPort(this._docPixelSize.y, height); this._rows.setViewPort(this._docPixelSize.y, height);
} }