mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-15 16:04:01 +00:00
32 lines
740 B
JavaScript
32 lines
740 B
JavaScript
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() {
|
|
console.log(this.template({groups: this.groups.models}));
|
|
},
|
|
|
|
fetch: function() {
|
|
this.groups.fetch({reset: true});
|
|
},
|
|
|
|
});
|
|
|
|
return GroupNavView;
|
|
});
|