Hi, fellows 

I wrote that code which set center of my timeline bands. If minDate is 1000 
and max date is 2000 from filtered data, my logic set center date 1500. 

First I added that code as onclick with timeout 2000ms on facet link, but 
when some click are done quickly, timeline gets broken. 
May be it's problem with the synchronization with the animation of 
timeline. 

So, do you know where I can invoke my function, so timeline to work properly

My code is:

function setTimelineCenterDate() {
    var arr = exhibit.getDefaultCollection().getRestrictedItems().toArray();
    var min;
    var max;
    if (arr.length > 0) {
        min = exhibit.getDatabase().getObject(arr[0], "creationDate");
        max = min;
        var id;
        var val;
        for ( var i = 1; i < arr.length; i++) {
            val = exhibit.getDatabase().getObject(arr[i], "creationDate");
            if (val < min) {
                min = val;
            }
            if (val > max) {
                max = val;
            }
        }
        var intMin = parseInt(min);
        var intMax = parseInt(max);
        var middle = intMin + (intMax - intMin) / 2;
        timelineCenterDate = 
Timeline.DateTime.parseGregorianDateTime(middle);
    } else {
        timelineCenterDate = Timeline.DateTime
                .parseGregorianDateTime(getCurrentDate());
    }
    if (nuxeoTimeline != undefined) {
        setTimelineBandsCenterDate(nuxeoTimeline, timelineCenterDate)
    }
}

function setTimelineBandsCenterDate(nuxeo_timline) {
    nuxeo_timline.getBand(0).setCenterVisibleDate(timelineCenterDate);
    nuxeo_timline.getBand(1).setCenterVisibleDate(timelineCenterDate);
}

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/simile-widgets/-/4vrgVORgrfQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.

Reply via email to