diff --git a/source/Ox.UI/js/Code/ExamplePanel.js b/source/Ox.UI/js/Code/ExamplePanel.js index 24ca3e30..caf13d9f 100644 --- a/source/Ox.UI/js/Code/ExamplePanel.js +++ b/source/Ox.UI/js/Code/ExamplePanel.js @@ -118,7 +118,9 @@ Ox.ExamplePanel = function(options, self) { return a < b ? -1 : a > b ? 1 : 0; }) : []; items.push(item); - items.length == self.options.examples.length && callback(items); + if (items.length == self.options.examples.length) { + callback(items.sort(sortById)); + } }); }); }); @@ -154,6 +156,10 @@ Ox.ExamplePanel = function(options, self) { that.triggerEvent('select', {id: self.options.selected}); } + function sortById(a, b) { + return a.id < b.id ? -1 : a.id > b.id ? 1 : 0; + } + return that; };