Skip to content

Commit

Permalink
fix tree sync
Browse files Browse the repository at this point in the history
  • Loading branch information
dio-el-claire committed Sep 3, 2012
1 parent da50bba commit 964f9d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion elfinder.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
<script>
$().ready(function() {
$('#finder').elfinder({
requestType : 'post',
// requestType : 'post',

// url : 'php/connector.php',
url : 'php/connector.php',
Expand Down
16 changes: 7 additions & 9 deletions js/ui/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,12 @@ $.fn.elfindertree = function(fm, opts) {

if (opts.syncTree) {
if (current.length) {
current.parentsUntil('.'+root).filter('.'+subtree).show().prev('.'+navdir).addClass(expanded);
} else if (fm.newAPI && !stopRec) {
// check if cwd is not in files
if ((dir = fm.file(cwd)).phash && tree.find('#'+fm.navHash2Id(dir.phash)).length) {
updateTree([dir]);
} else {
return;
}

return current.parentsUntil('.'+root).filter('.'+subtree).show().prev('.'+navdir).addClass(expanded);
}
if (fm.newAPI) {
// if ((dir = fm.file(cwd)).phash && tree.find('#'+fm.navHash2Id(dir.phash)).length) {
// updateTree([dir]);
// }
fm.request({
data : {cmd : 'parents', target : cwd},
preventFail : true
Expand All @@ -322,6 +319,7 @@ $.fn.elfindertree = function(fm, opts) {
cwd == fm.cwd().hash && sync(true);
});
}

}
},

Expand Down
2 changes: 1 addition & 1 deletion php/elFinder.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ protected function open($args) {
return array('error' => $this->error(self::ERROR_OPEN, $hash, self::ERROR_PERM_DENIED));
}

$files = array($cwd);
$files = array();

// get folders trees
if ($args['tree']) {
Expand Down

0 comments on commit 964f9d0

Please sign in to comment.