-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix scroll bugs with vertical scrollbar #2228
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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.
@@ -1070,6 +1072,7 @@ Core.prototype._onPinch = function (event) { | |||
* @private | |||
*/ | |||
Core.prototype._onDrag = function (event) { | |||
if (!event) return |
There was a problem hiding this comment.
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.
@@ -109,6 +104,11 @@ function Timeline (container, items, groups, options) { | |||
// current time bar | |||
this.currentTime = new CurrentTime(this.body); | |||
this.components.push(this.currentTime); | |||
|
|||
// apply options | |||
if (options) { |
There was a problem hiding this comment.
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.
@@ -390,6 +390,8 @@ Range.prototype._onDragStart = function(event) { | |||
* @private | |||
*/ | |||
Range.prototype._onDrag = function (event) { | |||
if (!event) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
There was a problem hiding this 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?
@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. |
No description provided.