DOM not ready when restoring adminer_tables_filter
(#289)
Uncaught TypeError: Cannot set property 'value' of null
This commit is contained in:
parent
1ce5b5ad31
commit
84e86cf572
|
@ -53,7 +53,7 @@ function tablesFilterInput() {
|
||||||
tablesFilterTimeout = window.setTimeout(tablesFilter, 200);
|
tablesFilterTimeout = window.setTimeout(tablesFilter, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sessionStorage){
|
sessionStorage && document.addEventListener('DOMContentLoaded', function () {
|
||||||
var db = qs('#dbs').querySelector('select');
|
var db = qs('#dbs').querySelector('select');
|
||||||
db = db.options[db.selectedIndex].text;
|
db = db.options[db.selectedIndex].text;
|
||||||
if (db == sessionStorage.getItem('adminer_tables_filter_db') && sessionStorage.getItem('adminer_tables_filter')){
|
if (db == sessionStorage.getItem('adminer_tables_filter_db') && sessionStorage.getItem('adminer_tables_filter')){
|
||||||
|
@ -61,7 +61,7 @@ if (sessionStorage){
|
||||||
tablesFilter();
|
tablesFilter();
|
||||||
}
|
}
|
||||||
sessionStorage.setItem('adminer_tables_filter_db', db);
|
sessionStorage.setItem('adminer_tables_filter_db', db);
|
||||||
}
|
});
|
||||||
</script>
|
</script>
|
||||||
<p class="jsonly"><input id="filter-field" autocomplete="off"><?php echo script("qs('#filter-field').oninput = tablesFilterInput;"); ?>
|
<p class="jsonly"><input id="filter-field" autocomplete="off"><?php echo script("qs('#filter-field').oninput = tablesFilterInput;"); ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in a new issue