Sort element index.
authorCameron McCormack <cam@mcc.id.au>
Mon, 20 Aug 2012 15:40:15 +1000
changeset 56 b2d9cbc10596
parent 55 2982871b4092
child 57 fc11ef98626e
Sort element index.
publish/processing.js
--- a/publish/processing.js	Mon Aug 20 10:38:38 2012 +1000
+++ b/publish/processing.js	Mon Aug 20 15:40:15 2012 +1000
@@ -599,7 +599,7 @@
 }
 
 function doElementIndex(conf, page, n) {
-  var elements = Object.keys(conf.definitions.elements).map(function(name) { return conf.definitions.formatElementLink(name) });
+  var elements = Object.keys(conf.definitions.elements).sort().map(function(name) { return conf.definitions.formatElementLink(name) });
   var index = utils.parse('<ul class="element-index" summary="Alphabetic list of elements">{{elements}}</ul>',
                           { elements: elements.map(function(e) { return utils.parse('<li>{{link}}</li>', { link: e }) }) });
   utils.replace(n, index);