Initialize modals more precisely
This commit is contained in:
parent
8aeeb1ddaa
commit
46544f58c6
@ -1,5 +1,5 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var dbtIdent = #{String $ dbtIdent};
|
||||
var dbtIdent = #{String dbtIdent};
|
||||
var headerDBTableShortcircuit = #{String (toPathPiece HeaderDBTableShortcircuit)};
|
||||
var selector = '#' + dbtIdent + '-table-wrapper';
|
||||
var wrapper = document.querySelector(selector);
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// TODO: replace for loop with one precise query for this specific modal instance
|
||||
var modalElements = Array.from(document.querySelectorAll('.modal'));
|
||||
modalElements.forEach(function(modal) {
|
||||
var modalIdent = #{String modalId};
|
||||
var selector = '#modal-' + modalIdent;
|
||||
var modal = document.querySelector(selector);
|
||||
|
||||
if (modal) {
|
||||
window.utils.setup('modal', modal);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user