2015-01-27 14:41:16 +00:00
|
|
|
define([
|
|
|
|
'jquery',
|
|
|
|
'underscore',
|
|
|
|
'backbone',
|
|
|
|
'common',
|
|
|
|
'app/collections/groups',
|
|
|
|
'text!' + app.config._tmplRoot + 'group-nav.html',
|
|
|
|
], function($, _, Backbone, Common, GroupCollection, GroupNavTemplate) {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var GroupNavView = Backbone.View.extend({
|
|
|
|
|
|
|
|
template: _.template(GroupNavTemplate),
|
|
|
|
|
|
|
|
initialize: function(options) {
|
|
|
|
this.groups = new GroupCollection();
|
|
|
|
this.listenTo(this.groups, 'reset', this.reset);
|
|
|
|
},
|
|
|
|
|
|
|
|
reset: function() {
|
2015-01-29 03:28:53 +00:00
|
|
|
//console.log(this.template({groups: this.groups.models}));
|
2015-01-27 14:41:16 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
fetch: function() {
|
|
|
|
this.groups.fetch({reset: true});
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return GroupNavView;
|
|
|
|
});
|