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

[lib setting] folder perm: open the jstree

This commit is contained in:
llj
2016-03-10 15:11:21 +08:00
parent 6fce263e42
commit 91c3f75251
5 changed files with 18 additions and 8 deletions

View File

@@ -55,8 +55,9 @@
<div id="mv-dir-list" class="dir-tree-cont"> <div id="mv-dir-list" class="dir-tree-cont">
<% if (show_cur_repo) { %> <% if (show_cur_repo) { %>
<h5 class="hd cspt"><span class="icon-caret-down"></span>{% trans "Current Library"%}</h5> <h5 class="hd cspt"><span class="icon-caret-down"></span>{% trans "Current Library"%}</h5>
<span class="loading-icon loading-tip"></span> <div id="current-repo-dirs">
<div id="current-repo-dirs"></div> <span class="loading-icon loading-tip"></span>
</div>
<% } %> <% } %>
<% if (show_other_repos) { %> <% if (show_other_repos) { %>
<div id="other-repos"> <div id="other-repos">

View File

@@ -26,6 +26,8 @@ define([
if (this.show_cur_repo) { if (this.show_cur_repo) {
FileTree.renderTreeForPath({ FileTree.renderTreeForPath({
$form: this.$el,
$container: this.$('#current-repo-dirs'),
repo_name: this.dir.repo_name, repo_name: this.dir.repo_name,
repo_id: this.dir.repo_id, repo_id: this.dir.repo_id,
path: this.dir.path path: this.dir.path

View File

@@ -160,11 +160,20 @@ define([
var $form = $('.js-folder-select-form', $permContent.parent()).slideDown(); var $form = $('.js-folder-select-form', $permContent.parent()).slideDown();
var $jstreeContainer = $('.js-jtree-container', $form); var $jstreeContainer = $('.js-jtree-container', $form);
/*
var repo_data = FileTree.formatRepoData([{ var repo_data = FileTree.formatRepoData([{
'id': this.repo_id, 'id': this.repo_id,
'name': this.repo_name 'name': this.repo_name
}]); }]);
FileTree.renderDirTree($jstreeContainer, $form, repo_data); FileTree.renderDirTree($jstreeContainer, $form, repo_data);
*/
FileTree.renderTreeForPath({
$form: $form,
$container: $jstreeContainer,
repo_id: this.repo_id,
repo_name: this.repo_name,
path: '/'
});
}, },
addFolder: function(e) { addFolder: function(e) {

View File

@@ -799,6 +799,8 @@ define([
if (show_cur_repo) { if (show_cur_repo) {
FileTree.renderTreeForPath({ FileTree.renderTreeForPath({
$form: form,
$container: $('#current-repo-dirs'),
repo_name: dir.repo_name, repo_name: dir.repo_name,
repo_id: dir.repo_id, repo_id: dir.repo_id,
path: dir.path path: dir.path

View File

@@ -190,10 +190,8 @@ define([
}, },
renderTreeForPath: function(options) { renderTreeForPath: function(options) {
// check templates/snippets/lib_op_popups.html for the template var form = options.$form,
var form = $('#mv-form'), container = options.$container;
container = $('#current-repo-dirs'),
loading_tip = container.prev();
var repo_name = options.repo_name, var repo_name = options.repo_name,
repo_id = options.repo_id; repo_id = options.repo_id;
@@ -256,7 +254,6 @@ define([
} }
json_data.push(repo_data); json_data.push(repo_data);
loading_tip.hide();
_this.renderDirTree(container, form, json_data); _this.renderDirTree(container, form, json_data);
container.removeClass('hide'); container.removeClass('hide');
}, },
@@ -266,7 +263,6 @@ define([
'attr': {'repo_id': repo_id, 'root_node': true}, 'attr': {'repo_id': repo_id, 'root_node': true},
'state': 'closed' 'state': 'closed'
}]; }];
loading_tip.hide();
_this.renderDirTree(container, form, cur_repo); _this.renderDirTree(container, form, cur_repo);
container.removeClass('hide'); container.removeClass('hide');
} }