From 52442801a7a52fc91b9426fc0cf886097cfa9118 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 24 May 2013 19:35:03 +0400 Subject: [PATCH] minor revision... Signed-off-by: Alex A. Naanou --- ui/marks.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ui/marks.js b/ui/marks.js index e9f7c1f2..03e240fc 100755 --- a/ui/marks.js +++ b/ui/marks.js @@ -12,10 +12,27 @@ * helpers... */ -function loadMarkedOnlyData(cmp){ +// NOTE: to disable MARKED cleanout set no_cleanout_marks to true. +// NOTE: MARKED may contain both gids that are not loaded and that do +// not exist, as there is no way to distinguish between the two +// situations the cleanup is optional... +function loadMarkedOnlyData(cmp, no_cleanout_marks){ cmp = cmp == null ? imageDateCmp : cmp var cur = DATA.current var marked = MARKED.slice().sort(cmp) + // this will ignore any gid in marks that is not in IMAGES... + // NOTE: if IMAGES contains only part of the data loadable this will + // be wrong... + if(!no_cleanout_marks){ + for(var i=0; i < marks.length;){ + if(marks[i] in IMAGES){ + i++ + continue + } + // NOTE: we do not need to advance i here... + marks.splice(i, 1) + } + } ALL_DATA = DATA DATA = { varsion: '2.0',