1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

[add repo] bugfix & improvement

This commit is contained in:
llj
2015-10-08 20:42:08 +08:00
parent 8dff8a8b2d
commit 8f8170fc3f

View File

@@ -43,7 +43,7 @@ define([
newAttributes: function() {
return {
name: $.trim($('input[name=repo_name]', this.$el).val()),
encrypted: $('#encrypt-switch', this.$el).parent().hasClass('checkbox-checked'),
encrypted: $('#encrypt-switch').prop('checked'),
passwd1: $('input[name=passwd]', this.$el).val(),
passwd2: $('input[name=passwd_again]', this.$el).val(),
passwd: $('input[name=passwd]', this.$el).val()
@@ -58,6 +58,7 @@ define([
addRepo: function(e) {
e.preventDefault();
Common.disableButton(this.$('[type="submit"]'));
var repos = this.repos;
repos.create(this.newAttributes(), {
wait: true,
@@ -79,11 +80,11 @@ define([
},
togglePasswdInput: function(e) {
var $parent = $(e.target).parent();
$parent.toggleClass('checkbox-checked');
var $checkbox = $('#encrypt-switch');
var pwd_input = this.$('input[type="password"]');
var pwd_input = $('input[type="password"]', $('.repo-create-encryption'));
if ($parent.hasClass('checkbox-checked')) {
$checkbox.parent().toggleClass('checkbox-checked');
if ($checkbox.prop('checked')) {
pwd_input.attr('disabled', false).removeClass('input-disabled');
} else {
pwd_input.attr('disabled', true).addClass('input-disabled');