hide non-universal styles from the main stylesheet menu (still selectable for vector...
authorRichard Fairhurst <richard@systemed.net>
Thu, 27 Jan 2011 22:00:54 +0000 (22:00 +0000)
committerRichard Fairhurst <richard@systemed.net>
Thu, 27 Jan 2011 22:00:54 +0000 (22:00 +0000)
net/systemeD/potlatch2/StyleSelector.mxml
net/systemeD/potlatch2/collections/Stylesheets.as
resources/stylesheets.xml

index 28c3cb9fb729be66f4c8251c0cf887c25580a61c..d839ad7f8d1309ea58795f7f15e6b8cb2663fcd5 100644 (file)
@@ -10,7 +10,7 @@
                dataProvider="{Stylesheets.instance().getCollection()}"
                rowCount="{Stylesheets.instance().getCollection().length}" />
 
-       <mx:Button label="Edit..." click="new BackgroundDialog().init('Map style',mapStyle,Stylesheets.instance());" />
+       <mx:Button label="Edit..." click="Application.application.styleButton.close(); new BackgroundDialog().init('Map style',mapStyle,Stylesheets.instance());" />
 
        <mx:Script><![CDATA[
                import net.systemeD.halcyon.*;
index 29c5038b593066488c81d39402191272dd18f8ee..b399b6d27b66d94dec5874abccb9525ec58e6591 100644 (file)
@@ -89,8 +89,11 @@ package net.systemeD.potlatch2.collections {
                
                [Bindable(event="collection_changed")]
                public function getCollection():ArrayCollection {
-                       return new ArrayCollection(collection);
+                       var available:Array=[];
+                       for each (var ss:Object in collection) {
+                               if (!ss.corestyle || ss.corestyle!='no') available.push(ss);
+                       }
+                       return new ArrayCollection(available);
                }
-
        }
 }
index 18da7c50ac7b58a5f6f9e36c9e8b9c62d1cce0a8..01fcac28dc0b5b5279e7665423ec6d581350710e 100644 (file)
     <stylesheet>
         <name>GPS</name>
         <url>stylesheets/gpx.css</url>
+        <corestyle>no</corestyle>
     </stylesheet>
     <stylesheet>
         <name>Bugs</name>
         <url>stylesheets/bugs.css</url>
+        <corestyle>no</corestyle>
     </stylesheet>
 </stylesheets>