minor tweaks and fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-12-20 04:59:08 +04:00
parent 736ffac934
commit 5a5e0366ba
2 changed files with 13 additions and 7 deletions

View File

@ -1568,7 +1568,7 @@ function alignDataToRibbon(base_ribbon, data, start, end){
// prepare for and fire the event... // prepare for and fire the event...
// XXX not sure if this is correct yet... // XXX not sure if this is correct yet...
var gids = [] var gids = []
sections[1].forEach(function(ribbon){ sections[1].ribbons.forEach(function(ribbon){
gids = gids.concat(ribbon) gids = gids.concat(ribbon)
}) })
// XXX do we need sections[1] passed here? // XXX do we need sections[1] passed here?

View File

@ -23,22 +23,28 @@ var TAGS = {}
/*********************************************************************/ /*********************************************************************/
function buildTagsFromImages(images, tagset){ function buildTagsFromImages(tagset, images){
tagset = tagset == null ? TAGS : tagset tagset = tagset == null ? TAGS : tagset
images = images == null ? IMAGES : images images = images == null ? IMAGES : images
for(gid in images){ for(var gid in images){
var tags = images[gid].tags var tags = images[gid].tags
if(tags == null){ // no tags in this image...
if(tags == null || tags.length == 0){
continue continue
} }
tags.map(function(tag){ tags.forEach(function(tag){
// first time we see this tag...
if(tagset[tag] == null){ if(tagset[tag] == null){
tagset[tag] = [] tagset[tag] = []
} }
// only update if not tagged...
if(tagset[tag].indexOf(gid) < 0){
tagset[tag].push(gid) tagset[tag].push(gid)
}
}) })
} }
return tagset
} }
@ -305,7 +311,7 @@ function setupTags(viewer){
return viewer return viewer
.on('imagesLoaded', function(){ .on('imagesLoaded', function(){
TAGS = [] TAGS = {}
showStatusQ('Tags: Index: building...') showStatusQ('Tags: Index: building...')