Skip to content

Commit

Permalink
Convert definitions into collection
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed May 15, 2017
1 parent dcf177f commit d131e1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions client/galaxy/scripts/apps/panels/admin-panel.js
@@ -1,6 +1,6 @@
var _l = require( 'utils/localization' );

var Categories = [ {
var Categories = new Backbone.Collection([{
title : 'Server',
items : [ {
title : 'Data types registry',
Expand Down Expand Up @@ -106,7 +106,7 @@ var Categories = [ {
url : 'requests_common/find_samples?cntrller=requests_admin'
} ]
}
];
]);

var AdminPanel = Backbone.View.extend({
initialize: function( page, options ) {
Expand All @@ -117,15 +117,16 @@ var AdminPanel = Backbone.View.extend({
});
this.setElement( this._template() );
this.$menu = this.$( '.toolMenu' );
window.console.log( Categories );
},

render : function() {
var self = this;
this.$menu.empty();
_.each( Categories, function( categories ) {
var $section = $( self._templateSection( categories ) );
Categories.each( function( category ) {
var $section = $( self._templateSection( category.attributes ) );
var $entries = $section.find( '.toolSectionBg' );
_.each( categories.items, function( item ) {
_.each( category.get( 'items' ), function( item ) {
var $link = $( '<a/>' ).attr({
href : self.root + item.url,
target : 'galaxy_main'
Expand Down
2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js.map

Large diffs are not rendered by default.

0 comments on commit d131e1b

Please sign in to comment.