Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about a callback option on the render function? #79

Open
phoebebright opened this issue Aug 18, 2024 · 1 comment
Open

How about a callback option on the render function? #79

phoebebright opened this issue Aug 18, 2024 · 1 comment
Assignees

Comments

@phoebebright
Copy link

I'm trying to tweak the formatting after drawing the milestones because it is not playing nice with bootstrap.
But if I try to do this after calling milestones() nothing happens, even when I put it in a log timeout. Works fine if I use debug and pause it there:

$(".milestones").css("margin-left", "10%")
    .css("position", "relative");

even this doesn't apply the style change:

          milestones('#timeline')

                .parseTime('%s')
                .aggregateBy('hour')
                .orientation('vertical')
                .distribution('top-bottom')
                .labelFormat('%B%d %H:%M')
                .render(data);


            setTimeout(function() {
                $(".milestones").css("margin-left", "10%")
                    .css("position", "relative");
            }, 100000);

I tried adding a callback to the render function on a forked version but that doesn't work because of the chaining call that only allows a single argument (I think).
Maybe there is a simple way of doing this already? If not a callback would be really helpful so I could do:

          milestones('#timeline')

                .parseTime('%s')
                .aggregateBy('hour')
                .orientation('vertical')
                .distribution('top-bottom')
                .labelFormat('%B%d %H:%M')
                .render(data, function() {

                $(".milestones").css("margin-left", "10%")
                    .css("position", "relative");
            });
@walterra walterra self-assigned this Sep 10, 2024
@walterra
Copy link
Owner

Thanks for the suggestion, I'll try to find some time to look into that option!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants