homeflowjs 0.13.51 → 0.13.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "0.13.51",
3
+ "version": "0.13.52",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -681,7 +681,6 @@ export default class DraggableMap {
681
681
  })
682
682
  }
683
683
 
684
-
685
684
  getSearchableBounds() {
686
685
  return this.map.getBounds();
687
686
  }
@@ -754,4 +753,22 @@ export default class DraggableMap {
754
753
  hideOverlay() {
755
754
  this?._overlayElement?.classList?.remove('draggable-map-overlay--show')
756
755
  }
756
+
757
+ resetMap() {
758
+ const s = this.getSearch();
759
+ const url = `/search.ljson?${buildQueryString(s)}&count=50`;
760
+ fetch(url)
761
+ .then((response) => response.json())
762
+ .then((json) => {
763
+ if (this.drawSearchLoader) {
764
+ this.drawSearchLoader.style.display = 'none';
765
+ }
766
+ store.dispatch(setPagination(json.pagination))
767
+ if (json.properties) {
768
+ this.setSearchResponse(json);
769
+ } else {
770
+ store.dispatch(setProperties([]));
771
+ }
772
+ })
773
+ }
757
774
  }
@@ -272,8 +272,8 @@ export default class DrawableMap extends DraggableMap {
272
272
  this.onMapDrag();
273
273
  });
274
274
 
275
- Homeflow.registerEvent('reset_list_results_after_draw_deleted', () => {
276
- this.onMapDrag();
275
+ Homeflow.registerEvent('reset_drawable_map', () => {
276
+ this.resetMap();
277
277
  })
278
278
 
279
279
  return this.map.on("draw:deleted", e => {