From bf1766351e9845e5e018151e463a2681edbd7d50 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 29 May 2013 02:53:10 +0400 Subject: [PATCH] fixed a bug in updateRibbonsFromFavDirs()... Signed-off-by: Alex A. Naanou --- ui/data.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/data.js b/ui/data.js index 48afb4bd..d9229d49 100755 --- a/ui/data.js +++ b/ui/data.js @@ -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) }