Skip to content

Commit

Permalink
Ensuring that the Leaflet Map resize event does not trigger any searc…
Browse files Browse the repository at this point in the history
…hes (as moving the map should) within the search results interface
  • Loading branch information
jrgriffiniii committed Aug 3, 2018
1 parent cd53af8 commit 5602428
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/assets/javascripts/geoblacklight/modules/geosearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,19 @@
this.$dynamicButton.hide();
}

map.on("moveend", dynamicSearcher, this);
this.wasResized = false;
map.on("resize", function(event) {
this.wasResized = true;
}, this);

map.on("moveend", function(event) {
if (this.wasResized) {
this.wasResized = false;
} else {
dynamicSearcher.apply(this);
}
}, this);

map.on("movestart", function() {
if (!this.options.dynamic) {
this.$dynamicButton.hide();
Expand Down

0 comments on commit 5602428

Please sign in to comment.