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