Choose new CategorySelector when going from line to area
authorRichard Fairhurst <richard@systemeD.net>
Fri, 30 Mar 2012 12:11:53 +0000 (13:11 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Fri, 30 Mar 2012 12:11:53 +0000 (13:11 +0100)
net/systemeD/potlatch2/TagViewer.mxml

index 96f733e..52932a2 100644 (file)
       private var connection:Connection;
       private var currentCategorySelector:CategorySelector;
       private var categorySelectors:Object = {};       // hash of categorySelectors for each limitType
-      private var categorySelectorEntity:Entity;       // entity used to draw the categorySelector
+      private var categorySelectorEntity:Entity;       // entity used to draw the most recent categorySelector
+      private var categorySelectorLimitType:String;    // limit type used to draw the most recent categorySelector
       private var feature:Feature = null;
 
       private var rowData:Object;              // relation membership reference, needed so it's accessible from relation actions menu
           var oldEntity:Entity = categorySelectorEntity;
 
           feature = selectedEntity == null ? null : mapFeatures.findMatchingFeature(selectedEntity);
-          if (oldFeature==feature && categorySelectorEntity==selectedEntity) {
+          if (oldFeature==feature && 
+              categorySelectorEntity==selectedEntity && 
+              categorySelectorLimitType==limitType(selectedEntity)) {
               updateCategoryImageAndText(selectedEntity,feature);
               return;
           }
 
           categorySelectorEntity=selectedEntity;
+          categorySelectorLimitType=limitType(selectedEntity);
           if ( oldFeature != null ) { oldFeature.removeEventListener("imageChanged", featureImageChanged); }
           if ( feature != null )    { feature.addEventListener("imageChanged", featureImageChanged); }
                  setCategorySelector(selectedEntity, feature);