mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-18 00:00:00 +00:00
[sub lib] bugfix for 'create' & 'dir op bar'
This commit is contained in:
@@ -140,7 +140,7 @@
|
||||
<% if (user_perm == 'rw') { %>
|
||||
<a class="repo-trash-icon fright" href="<%= site_root %>repo/recycle/<%- repo_id %>/" target="_blank" title="{% trans 'Trash' %}"></a>
|
||||
<% } %>
|
||||
<% if (is_repo_owner) { %>
|
||||
<% if (is_repo_owner && !is_virtual) { %>
|
||||
<a class="repo-setting-icon fright" href="<%= site_root %>repo/<%- repo_id %>/settings/" target="_blank" title="{% trans 'Settings' %}"></a>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
@@ -263,16 +263,16 @@ define([
|
||||
},
|
||||
|
||||
renderDirOpBar: function() {
|
||||
var dir = this.dir,
|
||||
user_perm = dir.user_perm;
|
||||
var dir = this.dir;
|
||||
|
||||
this.$dir_op_bar.html($.trim(this.dir_op_bar_template({
|
||||
user_perm: user_perm,
|
||||
user_perm: dir.user_perm,
|
||||
encrypted: dir.encrypted,
|
||||
path: dir.path,
|
||||
repo_id: dir.repo_id,
|
||||
site_root: app.pageOptions.site_root,
|
||||
is_repo_owner: dir.is_repo_owner,
|
||||
is_virtual: dir.is_virtual,
|
||||
enable_upload_folder: app.pageOptions.enable_upload_folder
|
||||
})));
|
||||
},
|
||||
|
@@ -142,8 +142,7 @@ define([
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
$.modal.close();
|
||||
if (_this.repos.length > 0) {
|
||||
_this.repos.add({
|
||||
var new_sub_lib = {
|
||||
'id': data["sub_repo_id"],
|
||||
'name': data["name"],
|
||||
'origin_repo_id': ori_repo_id,
|
||||
@@ -151,9 +150,11 @@ define([
|
||||
'abbrev_origin_path': data["abbrev_origin_path"],
|
||||
'mtime': new Date().getTime() / 1000,
|
||||
'mtime_relative': gettext("Just now")
|
||||
}, {prepend: true});
|
||||
};
|
||||
if (_this.repos.length > 0) {
|
||||
_this.repos.add(new_sub_lib , {prepend: true});
|
||||
} else {
|
||||
_this.showMyRepos();
|
||||
_this.repos.reset([new_sub_lib]);
|
||||
}
|
||||
},
|
||||
error: function(xhr, textStatus, errorThrown) {
|
||||
|
Reference in New Issue
Block a user