pressing Enter in the changeset comment field automatically clicks 'Save'
authorRichard Fairhurst <richard@systemed.net>
Sat, 18 Dec 2010 10:05:59 +0000 (10:05 +0000)
committerRichard Fairhurst <richard@systemed.net>
Sat, 18 Dec 2010 10:05:59 +0000 (10:05 +0000)
net/systemeD/potlatch2/save/SaveDialog.mxml

index 2dd71e2a83d24783e64c1479e4eccdd64cd9523e..1ccae4bf7f4550006fb18d8a8b27d7f86ff773cd 100644 (file)
@@ -26,7 +26,7 @@
             </mx:text>
           </mx:Text>
           <mx:Label text="Comment:"/>
-          <mx:TextArea id="comment" width="100%" height="100%" change="commentChanged(event);" />
+          <mx:TextArea id="comment" width="100%" height="100%" change="commentChanged(event);" textInput="monitorEnter(event);" />
         </mx:VBox>
         
         <mx:VBox width="100%" height="100%" label="Advanced">
                changesetTags.addItem( { k:'comment', v: event.target.text } );
     }
 
+       private function monitorEnter(event:TextEvent):void {
+               if (event.text=="\n") { event.preventDefault(); startSave(); }
+       }
+
        private function addNewTag():void {
                changesetTags.addItem( { k:'(new key)', v:'(new value)' } );
                advancedTagGrid.editedItemPosition = { rowIndex: changesetTags.length-1, columnIndex: 0 };