diff --git a/composer.json b/composer.json index 4b69f8e..22c0568 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "newism/craft3-fields", "description": "Address, telephone and email fields for CraftCMS 3.x", "type": "craft-plugin", - "version": "0.0.22", + "version": "0.0.23", "keywords": [ "craft", "cms", @@ -26,7 +26,6 @@ } ], "require": { - "php": "^7.3", "craftcms/cms": "^3.0", "giggsey/libphonenumber-for-php": "^8.3", "commerceguys/addressing": "^1.0", diff --git a/src/assetbundles/addressfield/dist/js/Address.js b/src/assetbundles/addressfield/dist/js/Address.js index c783dcc..b75fa98 100644 --- a/src/assetbundles/addressfield/dist/js/Address.js +++ b/src/assetbundles/addressfield/dist/js/Address.js @@ -11,283 +11,281 @@ */ (function ($, Craft, window, document, undefined) { - // We need to create a callback for the Google Maps API to use when it has loaded - window.googleMapsPlacesApiLoaded = window.googleMapsPlacesApiLoaded || false; - window.googleMapsPlacesApiLoadedCallback = function () { - window.googleMapsPlacesApiLoaded = true; - document.body.dispatchEvent(new Event('googleMapsPlacesApiLoaded')); - }; - - var pluginName = 'NsmFieldsAddress', - defaults = {}; - - // Plugin constructor - function Plugin (element, options) { - this.$element = $(element); - this.options = $.extend({}, defaults, options); - this._defaults = defaults; - this._name = pluginName; - this.init(); - } - - Plugin.prototype = { - - getElement: function (element) { - return this.$element.find('#' + this.options.namespacedId + '-' + element); - }, - - init: function (id) { - - // Init country code - this.$addressFieldsContainer = this.$element.find('.nsmFields-address-addressFieldsContainer'); - this.$autoCompleteInput = this.getElement('autoComplete'); - this.$countryCodeInput = this.getElement('countryCode'); - this.currentCountryCode = this.$countryCodeInput.val(); - this.currentCountryCodeName = this.$countryCodeInput.find('option[value="'+this.currentCountryCode+'"]').text(); - this.$countryCodeInput.on('change', $.proxy(this.refreshCountry, this)); - this.$mapContainer = this.$element.find('.nsmFields-address-map') - - - // Add loading state - this.$spinner = $('