fix docs row click jumping, close #3609

This commit is contained in:
Vladimir Agafonkin 2015-07-10 17:56:14 +03:00
parent 39bf8e209c
commit 217a4beaf9

View File

@ -6374,14 +6374,19 @@ var Leaflet = L.noConflict();
<script>
var tables = document.getElementsByTagName('table');
for (var i = 0, len = tables.length; i < len; i++) {
var id = tables[i].getAttribute('data-id'),
tds = tables[i].getElementsByTagName('td');
for (var j = 0, tdLen = tds.length; j < tdLen; j++) {
if (tds[j].cellIndex === 0) {
tds[j].parentNode.id = id + '-' + (tds[j].textContent || tds[j].innerText).split('(')[0].toLowerCase();
tds[j].parentNode.onclick = function(e) {
window.location.hash = '#' + this.id;
if (e.offsetX < 0) {
window.location.hash = '#' + this.id;
}
};
}
}