Closed (fixed)
Project:
IMCE
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Sep 2008 at 17:36 UTC
Updated:
19 May 2011 at 21:24 UTC
I need help setting the default state of sub-directories to sort ascending.
Does anyone know how this could be accomplished.
Comments
Comment #1
epruett commentedComment #2
pauline_perren commentedsee http://drupal.org/node/298323
Comment #3
epruett commentedHere is how we solved our problem:
imce.js
//update navigation tree after getting subdirectories.
// added sorting just for subdirectories here...
dirSubdirs: function(dir, subdirs) {
var branch = imce.tree[dir];
// added
subdirs.sort();
// added
subdirs.reverse();
if (subdirs && subdirs.length) {
var prefix = dir == '.' ? '' : dir +'/';
for (var i in subdirs) {//add subdirectories
imce.dirAdd(prefix + subdirs[i], branch, true);
}
$(branch.li).removeClass('leaf').addClass('expanded');
$(branch.ul).show();
}
else if (!branch.ul){//no subdirs->leaf
$(branch.li).removeClass('expanded').addClass('leaf');
}
},
Comment #4
ufku commentedClosing 6.x-1.x issues as this branch is no more supported.