diff --git a/source/Ox.UI/js/Code/DocPage.js b/source/Ox.UI/js/Code/DocPage.js index 987b444b..e2fcb536 100644 --- a/source/Ox.UI/js/Code/DocPage.js +++ b/source/Ox.UI/js/Code/DocPage.js @@ -80,19 +80,32 @@ Ox.DocPage = function(options, self) { function getItem(item, level, name) { Ox.Log('Core', 'getItem', item, level, name) - var $elements = [$('
' + (name || item.name) + ' '
- + '<' + item.types.join('> or <') + '> '
- + (item['class'] ? '(class: ' + item['class'] + ') ' : '')
- + (item['default'] ? '(default: ' + item['default'] + ') ' : '')
- + Ox.sanitizeHTML(item.summary)
- )
- ];
- ['description'].concat(
- item.order || ['returns', 'arguments', 'properties', 'events']
- ).concat(['tests', 'source']).forEach(function(section) {
+ var $elements = [
+ $('' + (name || item.name) + ' '
+ + '<' + item.types.join('> or <') + '> '
+ + (item['class'] ? '(class: ' + item['class'] + ') ' : '')
+ + (item['default'] ? '(default: ' + item['default'] + ') ' : '')
+ + Ox.sanitizeHTML(item.summary)
+ )
+ ],
+ sections = ['description'].concat(
+ item.order || ['returns', 'arguments', 'properties']
+ ).concat(['events', 'tests', 'source']),
+ index = sections.indexOf('properties') + 1 || 1;
+ if (item.inherited) {
+ Array.prototype.splice.apply(sections, [index, 0].concat(
+ item.inherited.map(function(v, i) {
+ var section = 'properties inherited from '
+ + v.name + '';
+ item[section] = v.properties;
+ return section;
+ })
+ ));
+ }
+ sections.forEach(function(section) {
var className = 'OxLine' + Ox.uid();
if (item[section]) {
if (section == 'description') {
@@ -149,10 +162,13 @@ Ox.DocPage = function(options, self) {
});
})
)
- .append('' + Ox.toTitleCase(
- section == 'returns' ? 'usage'
- : section == 'tests' ? 'examples'
- : section
+ .append('' + (
+ Ox.startsWith('properties ', section) ? section
+ : Ox.toTitleCase(
+ section == 'returns' ? 'usage'
+ : section == 'tests' ? 'examples'
+ : section
+ )
) + '')
);
if (section == 'tests') {