Browse Source

Remove console logs

Tatiana Inama 6 years atrás
parent
commit
1e823ec95b
1 changed files with 1 additions and 81 deletions
  1. 1 81
      app.js

+ 1 - 81
app.js

@@ -7,21 +7,17 @@ const validField = (formId, fieldId, customFieldId) => {
   const element = form.querySelector(`#${fieldId}`);
   const element = form.querySelector(`#${fieldId}`);
   if (element.value === '') {
   if (element.value === '') {
     form.classList.add('was-validated');
     form.classList.add('was-validated');
-    console.log("invalid", fieldId)
     return false;
     return false;
   } else {
   } else {
     if (customFieldId && element.value === 'other') {
     if (customFieldId && element.value === 'other') {
       const customField = form.querySelector(`#${customFieldId}`);
       const customField = form.querySelector(`#${customFieldId}`);
       if (customField.value === '') {
       if (customField.value === '') {
         customField.classList.add('is-invalid');
         customField.classList.add('is-invalid');
-        console.log("invalidcustom", customFieldId)
         return false
         return false
       } else {
       } else {
-        console.log("valid custom", customFieldId)
         return true
         return true
       }
       }
     }
     }
-    console.log("custom with response", fieldId, customFieldId)
     return true;
     return true;
   }
   }
 }
 }
@@ -64,7 +60,6 @@ const isValid = condition => condition();
 
 
 const changePage = (page, condition) => {
 const changePage = (page, condition) => {
   if (condition && !conditions[condition].map(isValid).every(result => result)) {
   if (condition && !conditions[condition].map(isValid).every(result => result)) {
-    console.log("not all conditions passed");
     return;
     return;
   }
   }
   tabs[currentPage].style.display = 'none';
   tabs[currentPage].style.display = 'none';
@@ -72,79 +67,4 @@ const changePage = (page, condition) => {
   currentPage = page;
   currentPage = page;
 }
 }
 
 
-showPage(2);
-
-
-
-
-
-
-
-mapboxgl.accessToken = 'pk.eyJ1IjoidGluYW1hIiwiYSI6ImNpbWV2dDJudjAxM2Z0c2traGthOTJyZjYifQ.s_lP9rp2Iro7Urb4IZAzTQ';
-const bounds = [
-  [-2.460270, 53.370427],
-  [-2.062598, 53.552900]
-]
-
-const map = new mapboxgl.Map({
-  container: 'map',
-  style: 'mapbox://styles/tinama/ck7avipta06nj1jmomolvvrbr',
-  center: [-2.884808, 53.495743],
-  zoom: 9.5,
-});
-
-const Draw = new MapboxDraw({
-  displayControlsDefault: false,
-  controls: {
-    polygon: true,
-    trash: true
-  }
-  });
-
-console.log("turf", turf);
-
-const AddPopup = (map) => (area) => {
-  let polygon = turf.polygon(area);
-  let center = turf.centroid(polygon);
-  console.log(center, polygon)
-
-  return new mapboxgl.Popup({closeOnClick: false})
-    .setLngLat(center.geometry.coordinates)
-    .setHTML(`
-      <h3>form</h3>
-      <label for="data">some data</label>
-      <input type="text" class="form-control" id="data" placeholder="" required>
-      <button type="button">save</button>
-    `)
-    .addTo(map)
-}
-
-
-map.addControl(Draw, 'top-right');
-
-map.on('load', function() {
-  let drawnData = {};
-  map.on('draw.create', createArea);
-  map.on('draw.delete', deleteArea);
-  map.on('draw.update', updateArea);
-
-  function createArea(polygon) {
-    let area = polygon.features[0].geometry;
-    drawnData = {
-      ...drawnData,
-      [polygon.features[0].id]: area
-    };
-
-    console.log("create", area);
-    const popup = AddPopup(map)(area.coordinates);
-
-  }
-
-  function deleteArea(polygon) {
-    console.log('delete', polygon);
-  }
-
-  function updateArea(polygon) {
-    console.log('update', polygon)
-  }
-});
+showPage(2);