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:
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user