Changeset 1276

Show
Ignore:
Timestamp:
10/31/08 15:18:01 (2 months ago)
Author:
elemoine
Message:

correct bug where the modify feature handles remain when a feature just created (un-committed) is deleted

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/widgets/editing/FeatureEditingPanel.js

    r1258 r1276  
    335335     */ 
    336336    deleteFeatures: function() { 
    337         var toDelete = []; 
    338         var selected = this.layer.selectedFeatures; 
     337        var toDelete = [], selected = this.layer.selectedFeatures, feature; 
    339338        for (var i = selected.length - 1; i >= 0; i--) { 
    340             var feature = selected[i]; 
     339            feature = selected[i]; 
     340            // if the modify feature control has a selected feature, 
     341            // and it is the current feature, unselect it 
     342            if (this.modifyFeatureControl.feature == feature) { 
     343                this.modifyFeatureControl.selectControl.unselect(feature); 
     344            } 
    341345            if (feature.state == OpenLayers.State.INSERT) { 
    342346                // feature was created as part of the current "transaction", 
     
    346350                feature.state = OpenLayers.State.DELETE; 
    347351                toDelete.push(feature); 
    348             } 
    349             // if the modify feature control has a selected feature, 
    350             // unselect it 
    351             if (this.modifyFeatureControl.feature) { 
    352                 this.modifyFeatureControl.selectControl.unselect( 
    353                     this.modifyFeatureControl.feature 
    354                 ); 
    355352            } 
    356353        }