From 3de94b67ca65c0481f6ce3432db3cf18ffef2ad5 Mon Sep 17 00:00:00 2001 From: Peter Knut Date: Sun, 13 May 2018 09:49:09 +0200 Subject: [PATCH] Allow AdminerTablesFilter plugin to be used with third-party table list plugins (#275) --- plugins/tables-filter.php | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/plugins/tables-filter.php b/plugins/tables-filter.php index c446af20..e7abe6fd 100644 --- a/plugins/tables-filter.php +++ b/plugins/tables-filter.php @@ -27,8 +27,17 @@ function tablesFilter(){ } var tables = qsa('li', qs('#tables')); for (var i = 0; i < tables.length; i++) { - var a = qsa('a', tables[i])[1]; + var a = null; var text = tables[i].getAttribute('data-table-name'); + if (text == null) { + a = qsa('a', tables[i])[1]; + text = a.innerHTML.trim(); + + tables[i].setAttribute('data-table-name', text); + a.setAttribute('data-link', 'main'); + } else { + a = qs('a[data-link="main"]', tables[i]); + } if (value == '') { tables[i].className = ''; a.innerHTML = text; @@ -55,22 +64,6 @@ if (sessionStorage){ }

-

-