Fix order

This commit is contained in:
guerler
2016-08-30 19:02:36 -04:00
parent d65bf1e4f7
commit bee75fb779
@@ -41,14 +41,11 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs' ], function( Utils,
subset.list.push({
id : type_id,
title : ( type.zoomable ? '<span class="fa fa-search-plus"/>' : '' ) + type.title + ' (' + type.library + ')',
sortby : type.title,
url : remote_root + 'src/visualizations/' + self.app.split( type_id ) + '/logo.png'
});
});
subset.list.sort( function( a, b ) { return a.id < b.id ? -1 : 1; } );
filtered.push( subset );
});
filtered.sort( function( a, b ) { return a.sortby < b.sortby ? -1 : 1; } );
var $el = $( '<div/>' ).addClass( 'charts-grid' );
_.each( filtered, function( category ) {
$el.append( $( '<div/>' ).addClass( 'header ui-margin-top' ).html( '&bull;&nbsp;' + category.title ) );
@@ -57,7 +54,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs' ], function( Utils,
$el.append( self._templateThumbnailItem( type ) );
});
});
this.tabs.add( { id: Utils.uid(), title: 'Default', $el: $el } );
this.tabs.add( { id: Utils.uid(), title: 'Suggested visualizations', $el: $el } );
}
},
@@ -82,7 +79,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs' ], function( Utils,
_.each( index, function( d, i ) {
$el.append( self._templateRegularItem( d ) );
});
this.tabs.add({ id: Utils.uid(), title: 'List', $el: $el } );
this.tabs.add({ id: Utils.uid(), title: 'List of all visualizations', $el: $el } );
}
},