Add 'clear all bookmarks' button
authorRichard Fairhurst <richard@systemeD.net>
Sun, 19 Mar 2017 18:34:33 +0000 (18:34 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Sun, 19 Mar 2017 18:34:33 +0000 (18:34 +0000)
net/systemeD/potlatch2/BookmarkSelector.mxml

index f90e712..fe10e57 100644 (file)
       </s:layout>
     </s:List>
 
-       <s:Button id="addButton" label="Add..." click="FlexGlobals.topLevelApplication.bookmarkButton.close(); addBookmark();" />
+       <s:HGroup horizontalAlign="center">
+               <s:Button id="addButton" label="Add..." click="FlexGlobals.topLevelApplication.bookmarkButton.close(); addBookmark();" />
+               <s:Button id="clearButton" label="Clear all" click="FlexGlobals.topLevelApplication.bookmarkButton.close(); clearBookmarks();" />
+       </s:HGroup>
 
        <fx:Script><![CDATA[
                import net.systemeD.halcyon.*;
                userState.setProperty("bookmarks",bookmarks.source);
                try { userState.flush(); } catch (e:Error) {}
                }
+               
+               private function clearBookmarks():void {
+                       bookmarks.removeAll();
+               userState.setProperty("bookmarks",bookmarks.source);
+               try { userState.flush(); } catch (e:Error) {}
+               }
     ]]></fx:Script>
 </s:BorderContainer>