Changeset 2339 for ComponentRegistry/branches/ComponentRegistry-1.13.0-olha/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/CommentsPanel.as
- Timestamp:
- 10/30/12 16:47:35 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/branches/ComponentRegistry-1.13.0-olha/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/CommentsPanel.as
r2338 r2339 23 23 import mx.controls.Image; 24 24 import mx.controls.Label; 25 import mx.controls.Spacer; 25 26 import mx.controls.scrollClasses.ScrollBar; 26 27 … … 28 29 29 30 [Event(name="commentsLoaded",type="flash.events.Event")] 30 public class CommentsPanel extends Canvas31 public class CommentsPanel extends HBox 31 32 { 32 33 public static const COMMENTS_LOADED:String = "commentsLoaded"; 33 34 35 public static const SCROLL_BAR_SWITCHED_EVENT:String = "verticalScrollBarSwitched";36 [Bindable]37 private var _vScrollBarVisibility:Boolean;38 34 39 35 [Bindable] … … 42 38 43 39 private var commentsBox:VBox; 40 44 41 private const hPadding:int = 5; 45 42 private const vPadding:int = 5; 46 47 43 48 44 public function get commentListService():CommentListService { … … 57 53 public function CommentsPanel() 58 54 { 59 60 this.setStyle(" layout", "absolute");61 this. verticalScrollPolicy = "on";62 this.addEventListener(SCROLL_BAR_SWITCHED_EVENT, vScrollBarSwitchedHandler);55 this.setStyle("paddingLeft", 5); 56 this.setStyle("paddingTop", 5); 57 this.setStyle("paddingRight", 5); 58 63 59 // this is for responding to the deletion of comments. At this point there is no way to distinghuish between item and component deletion 64 60 // and that probably is fine since they mostly require the same response. It does mean that this component will also reload when a … … 67 63 } 68 64 69 private function vScrollBarSwitchedHandler(e:Event):void{ 70 this.verticalScrollBar.visible = _vScrollBarVisibility; 71 } 72 73 // where to put this dispatcher, where the panel is redrawn/made a displayObject? where is it? 74 public function vScrollBarDispatcher():void { 75 if (_vScrollBarVisibility != this.verticalScrollBar.accessibilityEnabled) { 76 _vScrollBarVisibility = this.verticalScrollBar.accessibilityEnabled; 77 dispatchEvent(new Event(SCROLL_BAR_SWITCHED_EVENT)); 78 } 79 } 65 80 66 81 67 private function makeRssLinkButton():RssLinkButton{ … … 84 70 rssButtonTmp.contextMenu = (new RssCommentsContextMenu(_itemDescription)).cm; 85 71 rssButtonTmp.addEventListener(MouseEvent.CLICK, goToFeed); 86 rssButtonTmp.setStyle("top", vPadding);87 rssButtonTmp.setStyle("right", hPadding);88 72 return rssButtonTmp; 89 73 } … … 96 80 removeAllChildren(); 97 81 82 98 83 if(_itemDescription != null) { 99 84 100 85 // A box for the comments (will be loaded in callback but should be shown first) 101 86 commentsBox = new VBox(); 102 commentsBox.setStyle("top", vPadding);103 commentsBox.setStyle("left", hPadding);104 87 addChild(commentsBox); 105 88 … … 110 93 111 94 95 112 96 // Rss feed "button" 113 97 if (! _itemDescription.isInUserSpace){ 98 var spacer:Spacer = new Spacer(); 99 spacer.percentWidth=100; 100 addChild(spacer); 114 101 var rssButton:RssLinkButton = makeRssLinkButton(); 115 102 addChild(rssButton); … … 157 144 // A panel for posting a comment (or a message 'login to post'); 158 145 addPostPanel(); 146 147 159 148 } 160 149
Note: See TracChangeset
for help on using the changeset viewer.