== Tag editing ==
** Doesn't always update selected tab when you select a new entity
-** Doesn't update selected tab when you change the relations on an entity
* Dynamic reloading of stylesheet/map_features, so that you don't need to reload the full page when editing them
* If a select name is too long then, the select menu seems to give a horizontal scrollbar instead of the name of the item e.g. cuisine#Coffee Shop
* If you have both inputSets names and buildingAddress, and name= key is filled in then the basic tab will get both, surely only name should be shown and building name should be ignored e.g. cafes. [Actually this was an issue of addr: being missing from one of them, however this may still be a problem for other overlapping inputSets]
public function set entity(entity:Entity):void {
_entity = entity;
- // TODO: we need to listen for add/removal and relation tag changes
+ entity.addEventListener(Connection.ADDED_TO_RELATION, relationsChanged);
+ entity.addEventListener(Connection.REMOVED_FROM_RELATION, relationsChanged);
dispatchEvent(new Event("relations_changed"));
}
- private function relationsChanged(event:TagEvent):void {
+ protected function relationsChanged(event:Event):void {
dispatchEvent(new Event("relations_changed"));
}
import mx.managers.PopUpManager;
import mx.core.*;
- public function addRoutes():void {
+ public function addRoutes(event:Event=null):void {
+ routeIcons.removeAllChildren();
+ addEventListener("routes_changed", addRoutes);
for each(var relation:Object in matchedRelations) {
var icon:RouteIcon = new RouteIcon();
icon.setRoute(relation, RouteEditorFactory(_factory).icon);
public function routeClicked(event:Event):void {
var relation:Object = RouteIcon(event.currentTarget).route;
- trace(relation+" is clicked");
var panel:RelationEditorPanel = RelationEditorPanel(
PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
panel.setRelation(relation["relation"]);
PopUpManager.centerPopUp(panel);
}
- public function addToRelation():void {
- new RelationSelectPanel().init(_entity, _factory.relationTags);
- }
-
+ public function addToRelation():void {
+ new RelationSelectPanel().init(_entity, _factory.relationTags);
+ }
+
+ override protected function relationsChanged(event:Event):void {
+ dispatchEvent(new Event("routes_changed"));
+ }
]]></mx:Script>
</edit:RelationMemberEditor>