Add mouse click for row

This commit is contained in:
Dennis Eichhorn 2017-05-01 14:07:46 +02:00
parent eaa9173df4
commit 970bc410b8

View File

@ -43,7 +43,7 @@
this.bindElement(e); this.bindElement(e);
} }
} else { } else {
const tables = document.querySelectorAll('.tables'), const tables = document.getElementsByTagName('table'),
length = !tables ? 0 : tables.length; length = !tables ? 0 : tables.length;
for (var i = 0; i < length; i++) { for (var i = 0; i < length; i++) {
@ -64,5 +64,14 @@
*/ */
jsOMS.UI.TableManager.prototype.bindElement = function (e) jsOMS.UI.TableManager.prototype.bindElement = function (e)
{ {
const rows = e.querySelectorAll('[data-href]'),
length = rows.length;
for(let i = 0; i < length; i++) {
rows[i].addEventListener('click', function(event) {
jsOMS.preventAll(event);
window.location = jsOMS.Uri.UriFactory.build(this.getAttribute('data-href'));
});
}
}; };
}(window.jsOMS = window.jsOMS || {})); }(window.jsOMS = window.jsOMS || {}));