2 * @class FeedViewer.FeedDetail
3 * @extends Ext.panel.Panel
5 * Shows the details of a particular feed
8 * Create a new Feed Detail
9 * @param {Object} config The config object
11 Ext.define('FeedViewer.FeedDetail', {
13 extend: 'Ext.panel.Panel',
14 alias: 'widget.feeddetail',
18 initComponent: function(){
19 this.display = Ext.create('widget.feedpost', {});
22 items: [this.createGrid(), this.createSouth(), this.createEast()]
24 this.relayEvents(this.display, ['opentab']);
25 this.relayEvents(this.grid, ['rowdblclick']);
26 this.callParent(arguments);
33 loadFeed: function(url){
34 this.grid.loadFeed(url);
38 * Creates the feed grid
40 * @return {FeedViewer.FeedGrid} feedGrid
42 createGrid: function(){
43 this.grid = Ext.create('widget.feedgrid', {
45 dockedItems: [this.createTopToolbar()],
54 this.loadFeed(this.url);
59 * Fires when a grid row is selected
61 * @param {FeedViewer.FeedGrid} grid
62 * @param {Ext.data.Model} rec
64 onSelect: function(grid, rec) {
65 this.display.setActive(rec);
69 * Creates top controller toolbar.
71 * @return {Ext.toolbar.Toolbar} toolbar
73 createTopToolbar: function(){
74 this.toolbar = Ext.create('widget.toolbar', {
75 cls: 'x-docked-noborder-top',
80 handler: this.onOpenAllClick
84 prependText: 'Preview: ',
87 changeHandler: this.readingPaneChange,
93 iconCls:'preview-bottom'
96 iconCls:'preview-right'
99 iconCls:'preview-hide'
108 toggleHandler: this.onSummaryToggle
115 * Reacts to the open all being clicked
118 onOpenAllClick: function(){
119 this.fireEvent('openall', this);
123 * Gets a list of titles/urls for each feed.
124 * @return {Array} The feed details
126 getFeedData: function(){
127 return this.grid.store.getRange();
132 * @param {Ext.button.Button} button The button
133 * @param {Boolean} pressed Whether the button is pressed
135 onSummaryToggle: function(btn, pressed) {
136 this.grid.getComponent('view').getPlugin('preview').toggleExpanded(pressed);
140 * Handle the checked item being changed
142 * @param {Ext.menu.CheckItem} item The checked item
144 readingPaneChange: function(cycle, activeItem){
145 switch (activeItem.text) {
149 this.south.add(this.display);
154 this.east.add(this.display);
164 * Create the south region container
166 * @return {Ext.panel.Panel} south
168 createSouth: function(){
169 this.south = Ext.create('Ext.container.Container', {
181 * Create the east region container
183 * @return {Ext.panel.Panel} east
185 createEast: function(){
186 this.east = Ext.create('Ext.panel.Panel', {