Skip to content

Commit

Permalink
Add class to draw control container to distinguish fields
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Jul 29, 2014
1 parent 6384057 commit 9b13024
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions leaflet/static/leaflet/leaflet.forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ L.GeometryField = L.Class.extend({

if (this.options.modifiable) {
map.addControl(drawControl);
L.DomUtil.addClass(drawControl._container, this.options.fieldid);

map.on('draw:created', this.onCreated, this);
map.on('draw:edited', this.onEdited, this);
Expand Down
5 changes: 3 additions & 2 deletions leaflet/templates/leaflet/widget.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@

{% if target_map %}
window.addEventListener('map:init', function (e) {
e.detail.map.on('map:loadfield', function (me) {
var target_map = e.detail.map;
target_map.on('map:loadfield', function (me) {
if (me.fieldid == 'id_{{ target_map }}') {
setTimeout(function () {
{{ id_map_callback }}(e.detail.map, e.detail.options);
{{ id_map_callback }}(target_map, e.detail.options);
}, 0);
}
});
Expand Down

0 comments on commit 9b13024

Please sign in to comment.