Skip to content

Commit

Permalink
Little bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvdgraaf committed Dec 20, 2018
1 parent f8eaa90 commit a70ad3f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/GoogleAutocomplete/widget/GoogleAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ define([

// dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
postCreate: function () {
logger.debug(this.id + ".postCreate");
// Create global variable to store data
// Load google library
this._loadGoogle();
Expand Down Expand Up @@ -104,7 +105,8 @@ define([

//start Google and create the map
_loadGoogle: function () {
if (google && !google.maps) {
logger.debug(this.id + ".LoadGoogle");
if (google && (!google.maps || (google.maps && !google.maps.places))) {
var params = (this.apiAccessKey !== "") ? "key=" + this.apiAccessKey + "&libraries=places&v=quarterly" : "libraries=places&v=quarterly";

if (google.loader && google.loader.Secure === false) {
Expand All @@ -122,6 +124,7 @@ define([
// Attach events to HTML dom elements
_setupEvents: function ()
{
logger.debug(this.id + "._setupEvents");
if(this.mobileSupport) {
$(document).on({'DOMNodeInserted': function() {
$('.pac-item, .pac-item span', this).addClass('needsclick');
Expand Down Expand Up @@ -154,7 +157,6 @@ define([
this.autocomplete.setComponentRestrictions({'country': this.countryLimitation.split(",")});
}


// Set event handler when something is selected.
google.maps.event.addListener(this.autocomplete, 'place_changed',lang.hitch(this, this._inputEvent));
} catch(err) {
Expand Down Expand Up @@ -210,7 +212,7 @@ define([

//console.log(val+'-'+addressType+'-'+attribute);
if(attribute !== '' && val !== ''){
console.log('Set ' + attribute + ' - ' + val);
logger.debug('Set ' + attribute + ' - ' + val);
this._contextObj.set(attribute, val);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="GoogleAutocomplete" version="1.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="GoogleAutocomplete" version="1.1.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="GoogleAutocomplete/GoogleAutocomplete.xml"/>
</widgetFiles>
Expand Down
Binary file not shown.
Binary file modified test/.svn/wc.db
Binary file not shown.
Binary file modified test/widgets/GoogleAutocomplete.mpk
Binary file not shown.

0 comments on commit a70ad3f

Please sign in to comment.