fixed a bug in updateRibbonsFromFavDirs()...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-05-29 02:53:10 +04:00
parent a2537c5b20
commit bf1766351e

View File

@ -466,13 +466,16 @@ function ribbonsFromFavDirs(path, images, cmp){
// collect the images...
$.each(files, function(i, e){
var _gid = index[e]
var found = /.*\.(jpg|jpeg)$/i.test(e) ? ribbon.push(_gid) : false
// filter out non-image files...
if(/.*\.(jpg|jpeg)$/i.test(e)){
ribbon.push(_gid)
}
// remove the found item from each of the below ribbons...
if(found !== false){
$.each(ribbons, function(i ,e){
$.each(ribbons, function(i ,e){
if(e.indexOf(_gid) != -1){
e.splice(e.indexOf(_gid), 1)
})
}
}
})
})
ribbons.push(ribbon)
}