Needs review
Project:
IMCE Tools
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2011 at 09:04 UTC
Updated:
16 Sep 2013 at 12:22 UTC
Jump to comment: Most recent file
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);
});
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | imce-search-image-preview-1216028-03.patch | 8.89 KB | soulfroys |
| #2 | imce_tools_search-preview-navigate-to-file-6.x.patch | 8.37 KB | petrica.martinescu |
Comments
Comment #1
tekante commented@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.
Comment #2
petrica.martinescu commentedAttached patch:
Comment #3
soulfroys@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!
Comment #4
globallog commentedHello,
Could you please share how to apply this #3 patch on 7.x version?
Comment #5
soulfroysHi
Unfortunately, this patch is for Drupal 6 only...