1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 06:33:48 +00:00

fix bug in create repo

This commit is contained in:
Daniel Pan
2015-03-01 10:44:00 +08:00
parent 341f864bc7
commit cfe0cdb138
3 changed files with 41 additions and 9 deletions

View File

@@ -4,24 +4,29 @@ define([
'backbone',
'common',
'app/collections/repos',
], function($, _, Backbone, Common, Repos) {
'text!' + app.config._tmplRoot + 'create-repo.html',
], function($, _, Backbone, Common, Repos, CreateRepoTemplate) {
'use strict';
var AddRepoView = Backbone.View.extend({
el: '#repo-create-form',
events: {
"submit": "addRepo",
"click #encrypt-switch": "togglePasswdInput"
},
tagName: 'div',
template: _.template(CreateRepoTemplate),
initialize: function(repos) {
this.repos = repos;
this.listenTo(repos, 'invalid', this.displayValidationErrors);
},
events: {
"submit": "addRepo",
"click #encrypt-switch": "togglePasswdInput"
},
render: function() {
this.$el.modal({appendTo: '#main', autoResize: true});
this.$el.html(this.template({}));
this.$el.modal();
},
// Generate the attributes for a new GroupRepo item.

View File

@@ -70,8 +70,8 @@ define([
},
createRepo: function() {
var dialog = new AddRepoView(this.repos);
dialog.render();
var addRepoView = new AddRepoView(this.repos);
addRepoView.render();
},