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()],
52 this.loadFeed(this.url);
57 * Fires when a grid row is selected
59 * @param {FeedViewer.FeedGrid} grid
60 * @param {Ext.data.Model} rec
62 onSelect: function(grid, rec) {
63 this.display.setActive(rec);
67 * Creates top controller toolbar.
69 * @return {Ext.toolbar.Toolbar} toolbar
71 createTopToolbar: function(){
72 this.toolbar = Ext.create('widget.toolbar', {
73 cls: 'x-docked-noborder-top',
78 handler: this.onOpenAllClick
82 prependText: 'Preview: ',
85 changeHandler: this.readingPaneChange,
91 iconCls:'preview-bottom'
94 iconCls:'preview-right'
97 iconCls:'preview-hide'
106 toggleHandler: this.onSummaryToggle
113 * Reacts to the open all being clicked
116 onOpenAllClick: function(){
117 this.fireEvent('openall', this);
121 * Gets a list of titles/urls for each feed.
122 * @return {Array} The feed details
124 getFeedData: function(){
125 return this.grid.store.getRange();
130 * @param {Ext.button.Button} button The button
131 * @param {Boolean} pressed Whether the button is pressed
133 onSummaryToggle: function(btn, pressed) {
134 this.grid.getComponent('view').getPlugin('preview').toggleExpanded(pressed);
138 * Handle the checked item being changed
140 * @param {Ext.menu.CheckItem} item The checked item
142 readingPaneChange: function(cycle, activeItem){
143 switch (activeItem.text) {
147 this.south.add(this.display);
152 this.east.add(this.display);
162 * Create the south region container
164 * @return {Ext.panel.Panel} south
166 createSouth: function(){
167 this.south = Ext.create('Ext.container.Container', {
178 * Create the east region container
180 * @return {Ext.panel.Panel} east
182 createEast: function(){
183 this.east = Ext.create('Ext.panel.Panel', {