Posted by apollonet on July 12, 2011 at 9:04am
4 followers
| Project: | IMCE Tools |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
Replace lines 19 to 24 ...
/*$(li).click(function () {
file = fullpath.substr(fullpath.lastIndexOf('/') + 1);
dir = fullpath.substr(0, fullpath.lastIndexOf('/'));
imce.dirActivate(dir);
imce.highlight(file);
});*/With :
$(li).click(function () {
fullpath_split = fullpath.split('/');
if(fullpath_split.length == 4)
dir = '.';
else
dir = fullpath_split[fullpath_split.length - 2];
file = fullpath_split[fullpath_split.length - 1];
if(dir != imce.conf.dir)
imce.navigate(dir);
imce.highlight(file);
});
Comments
#1
@appolonet - thank you for the patch, I've found the following issues and wondered if you might have some insight:
The navigation to the located directory only works for directories which are the initial descendent of the current directory. For example, if in directory A with a subdirectory of A/B/C then a file located in C is not displayed when selected. I've done some work to iterate and descend into the directories but there is an issue because each child must be loaded before continuing down the directory tree and there doesn't seem to be a way to hook into the loading processing to know when to continue.
#2
Attached patch:
#3
@petrica.martinescu
Unfortunately it didn't apply clean here, so I generated a new diff for someone who has the same problem. To apply the patch, copy the file to the module root (/imce_tools), then use "patch -p1 < imce-search-preview-image-1216028-03.patch". Use "patch -p1 -R < imce-search-image-preview-1216028-03.patch" to revert.
It worked almost fine, except for a few issues:
Despite these issues, I tested it with some users here and they liked it a lot.
Thank you for the patch!