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

Conversation

@yotamberk
Copy link
Member

@yotamberk yotamberk commented Oct 20, 2016

fixes #273, #1060, #466

@yotamberk yotamberk changed the title Add a vertical scroll option for timeline [solves #273] Add a vertical scroll option for timeline [solves #273, #1060, #466] Oct 20, 2016
Copy link
Member

@mojoaxel mojoaxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yotamberk I like that you fixed the RTL support!

But I also have requested quite some changes. I'm sorry! I realy don't want to discourage you but give you constructive feedback. If you have questions don't hesitate to ask me.

<br>

<script>
function showVisibleItems() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this function is never called. I think it should be removed.

document.getElementById("visibleItemsContainer").innerHTML += a;
};

// get selected item count from url parameter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see it there are no url parameters.

var count = 1000;

// create groups
var groups = new vis.DataSet([
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be easily done in a loop, but ok - I don't mind.

// create items
var items = new vis.DataSet();

var order = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use order and truck as the loop variables, than you don't need jand i.


// create a Timeline
var container = document.getElementById('mytimeline');
timeline = new vis.Timeline(container, null, options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, this one is mainly just taste but it would be shorter to write:

timeline = new vis.Timeline(container, items, groups, options);

I expect that also to be faster, because every setGroup and setItems propably requires a rerendering.


var scrollbarWidth = 0;
if (this.options.verticalScroll) {
scrollbarWidth = 16;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly the width of the scrollbar can be different in each browser. You need a hack to get it. Here is a nice explanation: http://stackoverflow.com/a/13382873/722162

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed =)

<link href="../../../dist/vis.css" rel="stylesheet" type="text/css" />


<style type="text/css">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure haw other examples handle this, but I think we don't need this style here. The reason is to keep the examples as clean an copyable as possible.

<script src="../../googleAnalytics.js"></script>
</head>

<body onresize="/*timeline.checkResize();*/">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove the onresize.

<h1>Timeline vertical scroll option</h1>

<div id="mytimeline"></div>
<br>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The <br> is not needed ;-)

};

// get selected item count from url parameter
var count = 1000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like countis only used once. I think the variable is not needed.

@mojoaxel
Copy link
Member

@yotamberk I also have the strange behavior, that the scrollbar shrinks if i scroll down.
I think it would be better to force a full rendering if the scrollbar is active. Now it feels strange!

@yotamberk
Copy link
Member Author

No problem! I'm fixing the other PR and then will work on these changes. No need to apologize! Reviews are necessary and I myself require them to improve!
Thanks for the review =)

@yotamberk
Copy link
Member Author

@mojoaxel I don't see the shrinking problem. Can you elaborate?

@mojoaxel
Copy link
Member

I don't see the shrinking problem. Can you elaborate?

Here you can see how the left scrollbar gets smaller and smaller as I scroll down:
visjs_2196

@yotamberk
Copy link
Member Author

ah... okay that's weird... I'll take a look at it.

@mojoaxel
Copy link
Member

@yotamberk And also please resolve the new conflict. Thx!

@mojoaxel mojoaxel merged commit b889a50 into visjs:develop Oct 21, 2016
@mojoaxel
Copy link
Member

@yotamberk That is really a big improvement! 🎉
Thanks a lot!! 👍

@yotamberk
Copy link
Member Author

My pleasure! Working on some other cool features!

  • more advanced React support,
  • updating range items (end time updating with current time)
  • and multi timed ranged items
  • bug fixes and improvments

@yotamberk yotamberk deleted the vertical-scroll branch October 21, 2016 19:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants