X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/docs/js/PageHeader.js diff --git a/docs/js/PageHeader.js b/docs/js/PageHeader.js new file mode 100644 index 00000000..faf57955 --- /dev/null +++ b/docs/js/PageHeader.js @@ -0,0 +1,37 @@ +/** + * Renders class name and icon in page header. + */ +Ext.define('Docs.PageHeader', { + singleton: true, + + /** + * Renders class in header. + * @param {Object} docClass class configuration object. + */ + load: function(docClass) { + if (!this.tpl) { + this.tpl = new Ext.XTemplate( + '

', + '{name}', + '', + 'xtype: {xtype}', + '', + '

', + { + getClass: function(cls) { + if (cls.component) { + return "component"; + } + else if (cls.singleton) { + return "singleton"; + } + else { + return "class"; + } + } + } + ); + } + Ext.get('top-block').update(this.tpl.apply(docClass)); + } +});