zet-lib 1.2.100 → 1.2.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Form.js CHANGED
@@ -451,7 +451,7 @@ Form.field = (obj) => {
451
451
  case 'location':
452
452
  displayForm = `${prepend}<input type="text" class="form-control" id="search_map_location" placeholder="type a place" ${required} value="" ${htmlOptions}>${information}${append}
453
453
  <textarea ${id} ${name} style="display: none" ${readonly} rows="2">${JSON.stringify(obj.value)}</textarea>
454
- <div id="map_${obj.id}" style="width: 100%;height: ${obj.height || 200}px"></div>`
454
+ <div id="map_${obj.id}" style="background-color:#C3C3C3;width: 100%;height: ${obj.height}px"></div>`
455
455
  break
456
456
 
457
457
  case 'dropzone':
package/lib/moduleLib.js CHANGED
@@ -91,6 +91,11 @@ m.location = function (req, res, key) {
91
91
  if(mapLocationJSON && mapLocationJSON.lat) {
92
92
  $("#search_map_location").val(mapLocationJSON.address1);
93
93
  initMap(mapLocationJSON.lat,mapLocationJSON.lon);
94
+ } else {
95
+ navigator.geolocation.getCurrentPosition(function(location) {
96
+ initMap(location.coords.latitude,location.coords.longitude);
97
+ $("#search_map_location").val("My Place");
98
+ });
94
99
  }
95
100
  searchAddressMap = document.querySelector("#search_map_location");
96
101
  autocompleteMap = new google.maps.places.Autocomplete(searchAddressMap, {
@@ -100,6 +105,7 @@ m.location = function (req, res, key) {
100
105
  searchAddressMap.focus();
101
106
  autocompleteMap.addListener("place_changed", fillInAddress);
102
107
  }
108
+
103
109
  function fillInAddress() {
104
110
  const place = autocompleteMap.getPlace();
105
111
  let lat = place.geometry.location.lat();
package/lib/zRoute.js CHANGED
@@ -2463,7 +2463,7 @@ zRoute.forms = (req, res, MYMODEL, relations, data = {}) => {
2463
2463
  if (obj.value) {
2464
2464
  objLocation = obj.value
2465
2465
  }
2466
- script += `let mapLocationJSON = ${JSON.stringify(objLocation)}`
2466
+ script += `let mapLocationJSON = ${JSON.stringify(objLocation)};`
2467
2467
  break
2468
2468
  case 'tinymce':
2469
2469
  obj.type = 'textarea'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.2.100",
3
+ "version": "1.2.102",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"