         #update popup
         this.popupize layer.feature, layer
 
-        $(document).trigger('mapeditor:feature_update', layer.feature)
+        $(this.element).trigger('mapeditor:feature_update', layer.feature)
 
         widget._saveUpdates()
         false


    navigateToLayer: (layer) ->
      this.map.fitBounds layer.getBounds()

    popupize: (feature, layer) ->
      popup = ""

        if this.options.useFeatures
          this.edition = L.geoJson(this.options.edit, {
            onEachFeature: (feature, layer) =>
              $(this.element).trigger('mapeditor:feature_add', feature)

              if feature.properties?
                this.popupize(feature, layer)
