From c12c49d4d1ea7ea103bc625f8debb1719ddf9af2 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 30 May 2012 00:28:14 +0200 Subject: [PATCH] update Ox.DocPage --- source/Ox.UI/js/Code/DocPage.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/Ox.UI/js/Code/DocPage.js b/source/Ox.UI/js/Code/DocPage.js index 1b2a648f..af19a42f 100644 --- a/source/Ox.UI/js/Code/DocPage.js +++ b/source/Ox.UI/js/Code/DocPage.js @@ -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('' + Ox.toTitleCase( - section == 'tests' ? 'examples' : section + section == 'returns' ? 'usage' + : section == 'tests' ? 'examples' + : section ) + '') ); 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 + ' returns ' : null; + var name = section == 'returns' ? + item.name + v.signature + + ' returns ' + + (v.name || '') : null; $elements = $elements.concat( Ox.map(getItem(v, level + 1, name), function($element) { return $element.addClass(className);