Merge branch 'jbpasquier/form-submission-refresh-display' into 'staging'
feature: update sib-display on form save See merge request startinblox/applications/sib-app!42
This commit is contained in:
commit
58da59fae3
@ -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,6 +25,16 @@ 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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//- Header login hide/show
|
||||
if(document.querySelector('sib-auth').getUser() !== null) {
|
||||
document.querySelector('button[role="log in"]').style.display = 'none';
|
||||
|
Loading…
Reference in New Issue
Block a user