Changeset 1893
- Timestamp:
- 04/19/12 15:25:40 (12 years ago)
- Location:
- ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/CommentPanel.as
r1710 r1893 3 3 import clarin.cmdi.componentregistry.common.Comment; 4 4 5 import flash.events.MouseEvent; 6 5 7 import mx.containers.HBox; 6 8 import mx.containers.VBox; 9 import mx.controls.Alert; 10 import mx.controls.Button; 7 11 import mx.controls.HRule; 8 12 import mx.controls.Label; 9 13 import mx.controls.Text; 10 14 import mx.events.CloseEvent; 15 11 16 public class CommentPanel extends VBox 12 17 { … … 44 49 commentText.percentWidth = 100; 45 50 addChild(commentText); 46 51 52 if(comment.canDelete) { 53 var deleteButton:Button = new Button(); 54 deleteButton.label = "Delete comment"; 55 deleteButton.addEventListener(MouseEvent.CLICK, confirmDeleteHandler); 56 addChild(deleteButton); 57 } 58 47 59 var rule:HRule = new HRule(); 48 60 rule.percentWidth = 100; … … 55 67 commentText.text = comment.comments; 56 68 } 69 70 private function confirmDeleteHandler(event:MouseEvent):void{ 71 Alert.show("Are you sure you want to delete this comment?", "Delete comment", Alert.OK|Alert.CANCEL, this, deleteHandler); 72 } 73 74 private function deleteHandler(event:CloseEvent):void { 75 if(event.detail == Alert.OK){ 76 Alert.show("Will delete","TODO"); 77 } 78 } 57 79 } 58 80 } -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/Comment.as
r1706 r1893 15 15 public var profileDescriptionId:String; 16 16 public var id:String; 17 public var canDelete:Boolean; 17 18 18 19 public function Comment():void{ … … 27 28 this.id = comment.id; 28 29 this.userName = comment.userName; 30 this.canDelete = comment.canDelete == "true"; 29 31 } 30 32
Note: See TracChangeset
for help on using the changeset viewer.