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