sort the testcase by title.

This commit is contained in:
jianglong0156 2015-08-11 11:22:01 +08:00
parent 8a8515e998
commit 89949248de
1 changed files with 9 additions and 0 deletions

View File

@ -114,6 +114,15 @@ var TestController = cc.LayerGradient.extend({
menu.x = 0;
menu.y = 0;
// sort the test title
testNames.sort(function(first, second){
if (first.title > second.title)
{
return 1;
}
return -1;
});
// add menu items for tests
this._itemMenu = new cc.Menu();//item menu is where all the label goes, and the one gets scrolled