/** * List of classes on front page. * Together with links to guides and icons legend. */ Ext.define('Docs.view.index.Container', { extend: 'Ext.container.Container', alias : 'widget.indexcontainer', cls: 'class-list', initComponent: function() { var tpl = new Ext.XTemplate( '

{title}

', '', '
{notice}
', '
', '
', '

Legend

', '', '
', '', '
', '

Guides

', '{guides}', '', '
', '
', '{categories}' ); this.html = tpl.apply(this.extractData()); this.callParent(arguments); }, // Extracts HTML from hidden elements in page extractData: function() { var data = { notice: Ext.get("notice-text"), guides: Ext.get("guides-content"), categories: Ext.get("categories-content") }; for (var i in data) { var el = data[i]; if (el) { // If page contains the div then extract its contents, // after that remove the original data[i] = el.dom.innerHTML; el.remove(); } } // Extract text data.title = Ext.query("title")[0].innerHTML; return data; } });