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

Setting rootpanel border to none stops updating #53

Closed
MojoDK opened this issue Mar 6, 2014 · 2 comments
Closed

Setting rootpanel border to none stops updating #53

MojoDK opened this issue Mar 6, 2014 · 2 comments

Comments

@MojoDK
Copy link

MojoDK commented Mar 6, 2014

Phew .. this was a hard one to track down.

Setting the rootpanel border to none in css inside the BODY TAGS, stops the timeline from updating. If you place it inside the HEAD tags it works.

So this DOESN'T work...

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <title>Timeline | Basic demo</title>
    <style type="text/css">
        body, html {
            font-family: sans-serif;
        }
    </style>
    <script type="text/javascript" src="/_base/assets/plugins/vis/dist/vis.js"></script>
    <link href="/_base/assets/plugins/vis/dist/vis.min.css" rel="stylesheet" />
</head>
<body>
    <style type="text/css">
        .vis.timeline.rootpanel {
            border: none;
        }
    </style>

    <div id="visualization"></div>
    <script type="text/javascript">
        var container = document.getElementById('visualization');
        var items = [
    { id: 1, content: 'item 1', start: '2013-04-20' },
    { id: 2, content: 'item 2', start: '2013-04-14' },
    { id: 3, content: 'item 3', start: '2013-04-18' },
    { id: 4, content: 'item 4', start: '2013-04-16', end: '2013-04-19' },
    { id: 5, content: 'item 5', start: '2013-04-25' },
    { id: 6, content: 'item 6', start: '2013-04-27' }
        ];
        var options = {};
        var timeline = new vis.Timeline(container, items, options);
    </script>
</body>
</html>

This DOES work...

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <title>Timeline | Basic demo</title>
    <style type="text/css">
        body, html {
            font-family: sans-serif;
        }

        .vis.timeline.rootpanel {
            border: none;
        }
    </style>
    <script type="text/javascript" src="/_base/assets/plugins/vis/dist/vis.js"></script>
    <link href="/_base/assets/plugins/vis/dist/vis.min.css" rel="stylesheet" />
</head>
<body>
    <div id="visualization"></div>
    <script type="text/javascript">
        var container = document.getElementById('visualization');
        var items = [
    { id: 1, content: 'item 1', start: '2013-04-20' },
    { id: 2, content: 'item 2', start: '2013-04-14' },
    { id: 3, content: 'item 3', start: '2013-04-18' },
    { id: 4, content: 'item 4', start: '2013-04-16', end: '2013-04-19' },
    { id: 5, content: 'item 5', start: '2013-04-25' },
    { id: 6, content: 'item 6', start: '2013-04-27' }
        ];
        var options = {};
        var timeline = new vis.Timeline(container, items, options);
    </script>
</body>
</html>

Since I'm using the timeline in partial vies in MVC, I would prefer being able to set the rootpanel border inside the body tags.

Don't know if there's a better way to remove the border?

:)

@josdejong
Copy link
Contributor

That's interesting... will have a look at it

@josdejong
Copy link
Contributor

This should be fixed now in v1.0.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

3 participants