feat: unify sync functionality with event-driven UI updates

- Refactored navbar sync button to dispatch 'sync-completed' event
- Configs page: removed duplicate 'Импорт с сервера' button, added auto-refresh on sync
- Projects page: wrapped initialization in DOMContentLoaded, added auto-refresh on sync
- Pricelists page: added auto-refresh on sync completion
- Consistent UX: all lists update automatically after 'Синхронизация' button click
- Removed code duplication: importConfigsFromServer() function no longer needed
- Event-driven architecture enables easy extension to other pages

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-02-10 11:11:10 +03:00
parent d8edd5d5f0
commit 99fd80bca7
4 changed files with 59 additions and 65 deletions

View File

@@ -235,6 +235,12 @@
document.addEventListener('DOMContentLoaded', function() {
checkPricelistWritePermission();
loadPricelists(1);
// Listen for sync completion events from navbar
window.addEventListener('sync-completed', function(e) {
// Reload pricelists on sync completion
loadPricelists(1);
});
});
</script>
{{end}}