Skip to content

Commit

Permalink
Merge pull request #15 from pkmnct/fix-ie
Browse files Browse the repository at this point in the history
Update script to work on Internet Explorer
  • Loading branch information
pkmnct authored Jan 29, 2021
2 parents 883587d + 231d07d commit 717d98c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The first step is to add the Google Maps API and this script to your survey's he

```html
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key={YOURKEYHERE}"></script>
<script src="https://unpkg.com/[email protected].0/dist/QualtricsGoogleMap.min.js"></script>
<script src="https://unpkg.com/[email protected].1/dist/QualtricsGoogleMap.min.js"></script>
```

Make sure to replace the `{YOURKEYHERE}` with your Google Maps API key.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qualtrics-google-map-lat-long",
"version": "2.0.0",
"version": "2.0.1",
"description": "Embed a customizable Google Map in your Qualtrics survey to collect location data",
"scripts": {
"lint": "eslint src/**.ts",
Expand Down
10 changes: 5 additions & 5 deletions src/QualtricsGoogleMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ const initGoogleMapsQuestion = (
const mapObject = document.createElement('div');
mapObject.setAttribute('id', `${id}-map`);
if (map.css) {
styles.append(`#${id}-map {${map.css}}`);
styles.innerText += `#${id}-map {${map.css}}`;
mapObject.setAttribute('style', map.css);
} else {
styles.append(`#${id}-map {height: 300px;}`);
styles.innerText += `#${id}-map {height: 300px;}`;
}
questionBody.appendChild(mapObject);

Expand All @@ -78,17 +78,17 @@ const initGoogleMapsQuestion = (
locationLabel.setAttribute('id', `${inputId}-label`);
locationLabel.setAttribute('class', 'QuestionText');
if (marker.autocomplete.labelCss) {
styles.append(`#${inputId}-label {${marker.autocomplete.labelCss}}`);
styles.innerText += `#${inputId}-label {${marker.autocomplete.labelCss}}`;
}
locationLabel.append(marker.autocomplete.label || marker.options.title || `Marker ${marker.options.label ? marker.options.label : index}`);
locationLabel.innerText = marker.autocomplete.label || marker.options.title || `Marker ${marker.options.label ? marker.options.label : index}`;
questionBody.appendChild(locationLabel);

// Make the autocomplete
const locationInput = document.createElement('input');
locationInput.setAttribute('id', inputId);
locationInput.setAttribute('class', 'InputText');
if (marker.autocomplete.css) {
styles.append(`#${id}-${index}-locationInput {${marker.autocomplete.css}}`);
styles.innerText += `#${id}-${index}-locationInput {${marker.autocomplete.css}}`;
}
questionBody.appendChild(locationInput);

Expand Down

0 comments on commit 717d98c

Please sign in to comment.