Changeset c4a0cc3 in osmose-frontend


Ignore:
Timestamp:
Mar 8, 2014 10:32:32 PM (6 years ago)
Author:
Frédéric Rodrigo <fred.rodrigo@…>
Children:
8228b39
Parents:
953c155
git-author:
Frédéric Rodrigo <fred.rodrigo@…> (07/03/2014 17:23:40)
git-committer:
Frédéric Rodrigo <fred.rodrigo@…> (08/03/2014 22:32:32)
Message:

Close marker in all case when corrected from editor

Location:
static/map
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • static/map/Osmose.Editor.js

    r953c155 rc4a0cc3  
    2323  }, 
    2424 
    25   edit: function (errors, layer, error, type, id, fix) { 
     25  edit: function (layer, error, type, id, fix) { 
    2626    this.show(); 
    2727    if (this._$container.data().user != "True") { 
     
    4646          url: '../api/0.2/error/' + error + '/done' 
    4747        }).done(function (data) { 
    48           errors.removeLayer(layer); 
     48          self.errors.corrected(layer); 
    4949        }); 
    5050      }); 
  • static/map/Osmose.Errors.js

    r4692325 rc4a0cc3  
    7979    } 
    8080  }, 
     81 
     82  corrected: function (layer) { 
     83    this._osmoseMarker.corrected(layer); 
     84  }, 
    8185}); 
  • static/map/Osmose.Marker.js

    r4692325 rc4a0cc3  
    7171                }); 
    7272                content.on('click', '.editor_edit, .editor_fix', function () { 
    73                   self._editor.edit(self, layer, this.getAttribute('data-error'), this.getAttribute('data-type'), this.getAttribute('data-id'), this.getAttribute('data-fix')); 
     73                  self._editor.edit(layer, this.getAttribute('data-error'), this.getAttribute('data-type'), this.getAttribute('data-id'), this.getAttribute('data-fix')); 
    7474                }); 
    7575                e.popup.setContent(content[0]); 
     
    8686    }); 
    8787  }, 
     88 
     89  corrected: function (layer) { 
     90    if (this.hasLayer(layer)) { 
     91      this.removeLayer(layer); 
     92    } else { 
     93      var self = this; 
     94      this.eachLayer(function (l) { 
     95        if (l.error_id == layer.error_id) { 
     96          self.removeLayer(l); 
     97          return; 
     98        } 
     99      }); 
     100    } 
     101  }, 
    88102}); 
  • static/map/map.js

    r4692325 rc4a0cc3  
    2828  var osmoseLayer = new OsmoseErrors(menu, urlVars, editor); 
    2929  mapOverlay['Osmose Errors'] = osmoseLayer; 
     30  editor.errors = osmoseLayer; 
     31 
    3032  var layers = L.control.layers(mapBases, mapOverlay); 
    3133  map.addControl(layers); 
Note: See TracChangeset for help on using the changeset viewer.