feature: update sib-display on form save
This commit is contained in:
parent
89db25fa85
commit
de6217dd2d
@ -3,9 +3,9 @@ document.addEventListener('DOMContentLoaded', function (event) {
|
||||
const rightMenus = Array.from(document.querySelectorAll('nav.jsRightMenu'));
|
||||
const viewsContainer = Array.from(document.querySelectorAll('.views-container'));
|
||||
|
||||
window.addEventListener('navigate', (event) => {
|
||||
//- View change event
|
||||
});
|
||||
// window.addEventListener('navigate', (event) => {
|
||||
// });
|
||||
|
||||
//- Toggle sub-menus
|
||||
menuWrappers.forEach(menuWrapper => {
|
||||
@ -25,4 +25,15 @@ document.addEventListener('DOMContentLoaded', function (event) {
|
||||
})
|
||||
});
|
||||
|
||||
//- Watch every sib-forms & update data-src of linked sib-display
|
||||
document.querySelectorAll('sib-form[data-src], sib-form[bind-resource]').forEach(function(el) {
|
||||
el.addEventListener("save", function() {
|
||||
let dataSrc = el.getAttribute('data-src');
|
||||
document.querySelectorAll('sib-display[data-src="'+dataSrc+'"]').forEach(function(e) {
|
||||
e.setAttribute('data-src', dataSrc);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user