diff --git a/view/frontend/templates/product/view/retailer/availability.phtml b/view/frontend/templates/product/view/retailer/availability.phtml index 15e765b..f323790 100644 --- a/view/frontend/templates/product/view/retailer/availability.phtml +++ b/view/frontend/templates/product/view/retailer/availability.phtml @@ -77,7 +77,7 @@ use Smile\RetailerOffer\Block\Catalog\Product\Retailer\Availability;
diff --git a/view/frontend/web/js/retailer/product-availability.js b/view/frontend/web/js/retailer/product-availability.js index cdf99dd..8dcde52 100644 --- a/view/frontend/web/js/retailer/product-availability.js +++ b/view/frontend/web/js/retailer/product-availability.js @@ -141,8 +141,6 @@ define([ /** * Geolocalize me button action - * - * @returns {string} */ geolocalizeMe: function() { registry.get(this.name + '.geocoder', function (geocoder) { @@ -153,8 +151,6 @@ define([ /** * Action on geolocation success - * - * @returns {string} */ geolocationSuccess: function(position) { if (position.coords && position.coords.latitude && position.coords.longitude) { @@ -169,8 +165,6 @@ define([ /** * Update list of displayed offers - * - * @returns {string} */ updateDisplayedOffers: function () { registry.get(this.name + '.map', function (map) { @@ -178,6 +172,19 @@ define([ this.map.refreshDisplayedMarkers(); this.displayedOffers(this.map.displayedMarkers()); }.bind(this)); + }, + + /** + * Load modal function to set moveend event on map + * + * @returns {string} + */ + loadRetailerAvailabilityModal : function () { + let self = this; + registry.get(this.name + '.map', function (map) { + this.map = map; + this.map.map.on('moveend', self.updateDisplayedOffers.bind(self)); + }.bind(this)); } }); });