mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
feat(globe): answer the clear and share actions through the globe actions store
The top-center bar is now GlobeActions.vue. The shell publishes whether a clear is under way and answers the clear and share buttons through the globe actions store, instead of binding listeners and writing attributes on the buttons. A shell disposed mid-clear resets the busy state, so the next shell's bar is not left busy. bindClearLayersControl stays exported and is deprecated.
This commit is contained in:
1 parent
f269f5be4f
commit
7edf8a577e
15 files changed
+242
-75
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { ref } from 'vue';
|
||||
import { createOwners } from './owners.js';
|
||||
|
||||
/**
|
||||
* The top-center globe actions as their view renders them. The shell
|
||||
* publishes whether a clear of the selected data layers is under way, and
|
||||
* answers the clear and share buttons through act().
|
||||
*/
|
||||
export const useGlobeActionsStore = defineStore('gev-globe-actions', () => {
|
||||
/** Whether a clear is under way; null until the shell first says. */
|
||||
const clearBusy = ref(null);
|
||||
|
||||
/** @param {boolean | null} busy null when no shell answers the clear. */
|
||||
function publishClearBusy(busy) {
|
||||
clearBusy.value = busy == null ? null : Boolean(busy);
|
||||
}
|
||||
|
||||
const { connect, detach, act } = createOwners();
|
||||
|
||||
return { clearBusy, publishClearBusy, connect, detach, act };
|
||||
});
|
||||
Reference in new issue
Block a user