mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
feat(globe): answer both reset buttons through the globe actions store
The top-center and cockpit reset buttons call the location controls' new reset() through the globe actions store, and render a reset under way from it, instead of the location controls binding their clicks and the navigation writing their labels. The store keeps each owner's reset under way like its clear, and controls replaced mid-reset keep it on the buttons. LocationControls no longer takes resetButtons.
This commit is contained in:
1 parent
eccaeea0c4
commit
b4ee2321cf
17 files changed
+173
-84
No files matched your search
@@ -19,7 +19,8 @@ const LOCATION_MINI_SEARCHED_PLACEHOLDER = Object.freeze(
|
||||
* mini status, the search error and the ORBIT indicator are presented as a
|
||||
* plain view and handed to `publish`; Core's dock renders them and calls
|
||||
* `chooseCity()` and `choosePoi()`, and the scene chrome shows the indicator.
|
||||
* The search field and reset buttons keep their listeners.
|
||||
* The globe actions and the cockpit call `reset()`. The search field keeps its
|
||||
* listeners.
|
||||
*/
|
||||
export class LocationControls {
|
||||
constructor({
|
||||
@@ -90,8 +91,6 @@ export class LocationControls {
|
||||
this.bind(elements.search, 'blur', () => {
|
||||
if (!elements.search.value) onSearchEdit?.();
|
||||
});
|
||||
for (const button of elements.resetButtons)
|
||||
this.bind(button, 'click', onReset);
|
||||
this.present();
|
||||
}
|
||||
bind(element, event, handler, removers = this.removers) {
|
||||
@@ -132,6 +131,10 @@ export class LocationControls {
|
||||
chooseCity(id) {
|
||||
if (!this.destroyed) this.onCity(id);
|
||||
}
|
||||
/** A reset to the full globe view was asked for. */
|
||||
reset() {
|
||||
if (!this.destroyed) return this.onReset();
|
||||
}
|
||||
/** A landmark pill of the shown city was clicked. */
|
||||
choosePoi(index) {
|
||||
if (!this.destroyed && this.poiCity !== null)
|
||||
|
||||
Reference in new issue
Block a user