Commit 9aadc669 authored by Frank Bergmann's avatar Frank Bergmann

- Added < and > options to move the timeline

- Fixed issue with wrong week numbers
parent 0a780609
......@@ -198,9 +198,11 @@ function launchGanttEditor(debug){
{ icon: gifPath+'link_add.png', tooltip: 'Add dependency', id: 'buttonAddDependency', hidden: true},
{ icon: gifPath+'link_break.png', tooltip: 'Break dependency', id: 'buttonBreakDependency', hidden: true},
'->',
{ icon: gifPath+'resultset_previous.png', tooltip: 'Zoom in time axis', id: 'buttonZoomLeft'},
{ icon: gifPath+'zoom_in.png', tooltip: 'Zoom in time axis', id: 'buttonZoomIn'},
{ icon: gifPath+'zoom.png', tooltip: 'Center', id: 'buttonZoomCenter'},
{ icon: gifPath+'zoom_out.png', tooltip: 'Zoom out of time axis', id: 'buttonZoomOut'},
{ icon: gifPath+'zoom_out.png', tooltip: 'Zoom out of time axis', id: 'buttonZoomOut'},
{ icon: gifPath+'resultset_next.png', tooltip: 'Zoom in time axis', id: 'buttonZoomRight'},
'->',
{ text: 'Configuration', icon: gifPath+'wrench.png', menu: configMenu},
{ text: 'Help', icon: gifPath+'help.png', menu: helpMenu}
......
......@@ -54,7 +54,9 @@ Ext.define('GanttEditor.controller.GanttZoomController', {
me.control({
'#buttonZoomIn': { click: me.onButtonZoomIn },
'#buttonZoomOut': { click: me.onButtonZoomOut },
'#buttonZoomCenter': { click: me.onButtonZoomCenter }
'#buttonZoomCenter': { click: me.onButtonZoomCenter },
'#buttonZoomLeft': { click: me.onButtonZoomLeft },
'#buttonZoomRight': { click: me.onButtonZoomRight }
});
// Catch scroll events
......@@ -271,6 +273,62 @@ Ext.define('GanttEditor.controller.GanttZoomController', {
if (me.debug) console.log('GanttEditor.controller.GanttZoomController.onButtonZoomOut: Finished');
},
/**
* Zoom Right - The user has pressed the (<) button.
*/
onButtonZoomRight: function() {
var me = this;
if (me.debug) console.log('GanttEditor.controller.GanttZoomController.onButtonZoomRight: Starting');
var ganttBarPanel = me.getGanttBarPanel();
var panelBox = ganttBarPanel.getBox();
var panelWidth = panelBox.width;
var startTime = ganttBarPanel.axisStartDate.getTime();
var endTime = ganttBarPanel.axisEndDate.getTime();
var diffTime = endTime - startTime;
startTime = startTime + (diffTime / 2.0);
endTime = endTime + (diffTime / 2.0);
ganttBarPanel.axisStartDate = new Date(startTime);
ganttBarPanel.axisEndDate = new Date(endTime);
me.getGanttBarPanel().needsRedraw = true;
// Persist changes
me.senchaPreferenceStore.setPreference('axisStartTime', startTime);
me.senchaPreferenceStore.setPreference('axisEndTime', endTime);
if (me.debug) console.log('GanttEditor.controller.GanttZoomController.onButtonZoomRight: Finished');
},
/**
* Zoom Left - The user has pressed the (<) button.
*/
onButtonZoomLeft: function() {
var me = this;
if (me.debug) console.log('GanttEditor.controller.GanttZoomController.onButtonZoomLeft: Starting');
var ganttBarPanel = me.getGanttBarPanel();
var panelBox = ganttBarPanel.getBox();
var panelWidth = panelBox.width;
var startTime = ganttBarPanel.axisStartDate.getTime();
var endTime = ganttBarPanel.axisEndDate.getTime();
var diffTime = endTime - startTime;
startTime = startTime - (diffTime / 2.0);
endTime = endTime - (diffTime / 2.0);
ganttBarPanel.axisStartDate = new Date(startTime);
ganttBarPanel.axisEndDate = new Date(endTime);
me.getGanttBarPanel().needsRedraw = true;
// Persist changes
me.senchaPreferenceStore.setPreference('axisStartTime', startTime);
me.senchaPreferenceStore.setPreference('axisEndTime', endTime);
if (me.debug) console.log('GanttEditor.controller.GanttZoomController.onButtonZoomLeft: Finished');
},
/**
* Zoom towards a task selected by the user.
* Set the scroll bar so that the task is shown in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment