From 970bc410b885a54ef3267c868215f1483e992a10 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 1 May 2017 14:07:46 +0200 Subject: [PATCH] Add mouse click for row --- UI/TableManager.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/UI/TableManager.js b/UI/TableManager.js index d9ea90f..3e26e18 100644 --- a/UI/TableManager.js +++ b/UI/TableManager.js @@ -43,7 +43,7 @@ this.bindElement(e); } } else { - const tables = document.querySelectorAll('.tables'), + const tables = document.getElementsByTagName('table'), length = !tables ? 0 : tables.length; for (var i = 0; i < length; i++) { @@ -64,5 +64,14 @@ */ 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 || {}));