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 ChusavitinandClaude Haiku 4.5 committed 2026-02-10 11:11:10 +03:00
1 parent ca6c5fcdfd
commit 6d39ca7eba
4 files changed
+59 -65

No files matched your search

+6
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}}