Projet

Général

Profil

0001-misc-don-t-autosave-untouched-geolocalized-fields-33.patch

Frédéric Péters, 20 mai 2019 15:37

Télécharger (2,14 ko)

Voir les différences:

Subject: [PATCH] misc: don't autosave untouched geolocalized fields (#33114)

 wcs/qommon/static/js/qommon.forms.js       | 3 +++
 wcs/qommon/static/js/qommon.geolocation.js | 1 +
 wcs/qommon/static/js/qommon.map.js         | 1 +
 3 files changed, 5 insertions(+)
wcs/qommon/static/js/qommon.forms.js
26 26
    }
27 27
    autosave_timeout_id = window.setTimeout(autosave, 5000);
28 28
    $('#tracking-code a').on('click', autosave);
29
    $(document).on('wcs:set-last-auto-save', function() {
30
      last_auto_save = $('form[data-has-draft]').serialize();
31
    });
29 32
  }
30 33
  $('.date-pick').each(function() {
31 34
    var $date_input = $(this);
wcs/qommon/static/js/qommon.geolocation.js
42 42
      geoloc_prefill('postcode', data.address.postcode);
43 43
      geoloc_prefill('city', data.address.village || data.address.town || data.address.city || data.address.county);
44 44
      geoloc_prefill('country', data.address.country);
45
      $(document).trigger('wcs:set-last-auto-save');
45 46
      set_sync_callback()
46 47
    });
47 48
  });
wcs/qommon/static/js/qommon.map.js
78 78
       map.marker.setLatLng(coords);
79 79
       hidden.val(coords.lat + ';' + coords.lng);
80 80
       hidden.trigger('change');
81
       $(document).trigger('wcs:set-last-auto-save');
81 82
     });
82 83
     $map_widget.on('qommon:invalidate', function() {
83 84
       map.invalidateSize();
84
-