update Ox.DocPage

This commit is contained in:
rolux 2012-05-30 00:28:14 +02:00
parent 49adbe7048
commit c12c49d4d1

View file

@ -91,10 +91,9 @@ Ox.DocPage = function(options, self) {
+ Ox.sanitizeHTML(item.summary) + Ox.sanitizeHTML(item.summary)
) )
]; ];
[ ['description'].concat(
'description', 'usage', 'arguments', 'properties', item.order || ['returns', 'arguments', 'properties', 'events']
'events', 'tests', 'source' ).concat(['tests', 'source']).forEach(function(section) {
].forEach(function(section) {
var className = 'OxLine' + Ox.uid(); var className = 'OxLine' + Ox.uid();
if (item[section]) { if (item[section]) {
if (section == 'description') { if (section == 'description') {
@ -152,7 +151,9 @@ Ox.DocPage = function(options, self) {
}) })
) )
.append('<span class="OxSection">' + Ox.toTitleCase( .append('<span class="OxSection">' + Ox.toTitleCase(
section == 'tests' ? 'examples' : section section == 'returns' ? 'usage'
: section == 'tests' ? 'examples'
: section
) + '</span>') ) + '</span>')
); );
if (section == 'tests') { if (section == 'tests') {
@ -201,8 +202,10 @@ Ox.DocPage = function(options, self) {
); );
} else { } else {
item[section].forEach(function(v) { item[section].forEach(function(v) {
var name = section == 'usage' ? var name = section == 'returns' ?
item.name + v.name + ' </b></code>returns<code> <b>' : null; item.name + v.signature
+ ' </b></code>returns<code> <b>'
+ (v.name || '') : null;
$elements = $elements.concat( $elements = $elements.concat(
Ox.map(getItem(v, level + 1, name), function($element) { Ox.map(getItem(v, level + 1, name), function($element) {
return $element.addClass(className); return $element.addClass(className);