@@ -104,14 +104,14 @@
|
|||||||
<div class="split-pane-component l-timeline-pane t-pane-h l-pane-top t-timeline-gantt l-timeline-gantt s-timeline-gantt">
|
<div class="split-pane-component l-timeline-pane t-pane-h l-pane-top t-timeline-gantt l-timeline-gantt s-timeline-gantt">
|
||||||
<div class="l-hover-btns-holder s-hover-btns-holder t-btns-zoom">
|
<div class="l-hover-btns-holder s-hover-btns-holder t-btns-zoom">
|
||||||
<a class="t-btn l-btn s-btn"
|
<a class="t-btn l-btn s-btn"
|
||||||
ng-click="zoomController.zoom(-1)"
|
ng-click="zoomController.zoom(-1, scroll)"
|
||||||
ng-show="true"
|
ng-show="true"
|
||||||
title="Zoom in">
|
title="Zoom in">
|
||||||
<span class="ui-symbol icon zoom-in">X</span>
|
<span class="ui-symbol icon zoom-in">X</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="t-btn l-btn s-btn"
|
<a class="t-btn l-btn s-btn"
|
||||||
ng-click="zoomController.zoom(1)"
|
ng-click="zoomController.zoom(1, scroll)"
|
||||||
ng-show="true"
|
ng-show="true"
|
||||||
title="Zoom out">
|
title="Zoom out">
|
||||||
<span class="ui-symbol icon zoom-out">Y</span>
|
<span class="ui-symbol icon zoom-out">Y</span>
|
||||||
|
|||||||
@@ -80,11 +80,13 @@ define(
|
|||||||
* @returns {number} current zoom level (as the size of a
|
* @returns {number} current zoom level (as the size of a
|
||||||
* major tick mark, in pixels)
|
* major tick mark, in pixels)
|
||||||
*/
|
*/
|
||||||
zoom: function (amount) {
|
zoom: function (amount, bounds) {
|
||||||
// Update the zoom level if called with an argument
|
// Update the zoom level if called with an argument
|
||||||
if (arguments.length > 0 && !isNaN(amount)) {
|
if (arguments.length > 0 && !isNaN(amount)) {
|
||||||
|
var center = this.toMillis(bounds.x + bounds.width / 2);
|
||||||
setZoomLevel(zoomIndex + amount);
|
setZoomLevel(zoomIndex + amount);
|
||||||
storeZoom(zoomIndex);
|
storeZoom(zoomIndex);
|
||||||
|
bounds.x = this.toPixels(center) - bounds.width / 2;
|
||||||
}
|
}
|
||||||
return zoomLevels[zoomIndex];
|
return zoomLevels[zoomIndex];
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user