Thanks to visit codestin.com
Credit goes to github.com

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

Conversation

@yotamberk
Copy link
Member

No description provided.

Copy link
Contributor

@Tooa Tooa left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'm not sure about the braces. I usually prefer to have them even for single line commands. However, it looks like sometimes they are added and sometimes they are omitted.

function onMouseScrollSide(event) {
var current = this.scrollTop;
var adjusted = -current;
if (!me.options.verticalScroll) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

You should add curly braces here in order to be consistent with the code style.

* @private
*/
Core.prototype._onDrag = function (event) {
if (!event) return
Copy link
Contributor

Choose a reason for hiding this comment

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

Add curly braces and missing ;. See my comment above.

this.components.push(this.currentTime);

// apply options
if (options) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we have the braces. Is this some Javascript style convention to omit them if it's a return? I'm not sure.

* @private
*/
Range.prototype._onDrag = function (event) {
if (!event) return
Copy link
Contributor

Choose a reason for hiding this comment

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

See above.

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.

I think in case of only a "return" we don't have to force curly brackets. It's just tast!
@yotamberk Do you want to change it or leave it? Should I merge?

@yotamberk
Copy link
Member Author

@mojoaxel I kind of prefer without the curly braces. But it is a question of style. I think you can accept it like this. If we decide later differently, i'll be glad to change it.

@mojoaxel mojoaxel merged commit 33795a9 into visjs:develop Oct 25, 2016
@yotamberk yotamberk deleted the vertical-scroll branch October 28, 2016 09:09
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.

3 participants