Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

Default view on today? #15

Open
emb03 opened this issue Jun 9, 2013 · 4 comments
Open

Default view on today? #15

emb03 opened this issue Jun 9, 2013 · 4 comments

Comments

@emb03
Copy link

emb03 commented Jun 9, 2013

How do I specify that the default view shows the current day (the white line?)

Thanks

Looks gorgeous BTW

@cycloon
Copy link
Contributor

cycloon commented Aug 5, 2013

it does this by default, i think.

@cycloon
Copy link
Contributor

cycloon commented Sep 30, 2013

I think we can close this issue?

@antonioj1015
Copy link

I think he means the scroll bar automatically point to the current date.

@kevinawoo
Copy link

@antonioj1015 , here's a solution

I scrolled it in JS by doing this:

index.php:

<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>

<div id="gantti">
    <?php echo $gantti ?>
</div>

js:

    $("body > div[id]").each(function() {
        var id = "#" + $(this).attr('id');

        try {
            $(id + " .today")[0].scrollIntoView();

            var scrollLeft = $(id + " .gantt-data").scrollLeft();
            var position = $(id + " .today").position().left - $(id + " .gantt-day").width() * 1;
            $(id + " .gantt-data").scrollLeft(scrollLeft + position);
        } catch (e) {
            null;
        }
    });

    $(document).scrollTop(0);

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

No branches or pull requests

4 participants