-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add zoomIn and zoomOut to timeline core #2239
Conversation
<tr> | ||
<td>zoomIn(percentage)</td> | ||
<td>none</td> | ||
<td>Zoom in the current visible window. The parameter <code>percentage</code> can be a <code>Number</code>. If the parameter value of <code>percentage</code> is null, the window will be left unchanged. |
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.
We should make sure what a percentage
value is. Something between [0..1] or [0..100]?
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've enforced the percentage to be between 0 and 1 now
@@ -677,6 +677,46 @@ Core.prototype.getWindow = function() { | |||
}; | |||
|
|||
/** | |||
* Zoom in the window such that given time is centered on screen. | |||
* @param {String} time |
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.
should be something like this:
@param {Number} percentage Percentage of the min-max-timespan you want to zoom [0..1]
should be
@param {Number} percentage Percentage of the min-max-timespan you want to zoom [0..1]
* @param {String} time | ||
*/ | ||
Core.prototype.zoomIn = function(percentage) { | ||
if (!percentage) 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.
We also should check if percentage
is [0..1] otherwise throw an exception.
@@ -677,6 +677,46 @@ Core.prototype.getWindow = function() { | |||
}; | |||
|
|||
/** | |||
* Zoom in the window such that given time is centered on screen. | |||
* @param {Number} percentage |
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.
maybe an additional explanation? That the percentage of the min-max-timespan. Percentage must be be [0..1]
* @param {Number} percentage | ||
*/ | ||
Core.prototype.zoomIn = function(percentage) { | ||
if (!percentage) 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.
we should also check if percentage is [0..1]. Otherwise throw exception.
* @param {Number} percentage - must be between [0..1] | ||
*/ | ||
Core.prototype.zoomIn = function(percentage) { | ||
if (!percentage || percentage < 0 || percentage > 1) 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.
I don't like the (non existing) error handling. But as far as I it is not better in all the other functions so that's ok for now.
closes #1955