Commit b4ca6cd6 authored by Frank Bergmann's avatar Frank Bergmann

- Gantt Editor:

  Now resizing the surface when maximizing the Gantt Editor
parent d98ecc73
...@@ -284,6 +284,7 @@ function launchGanttEditor(debug){ ...@@ -284,6 +284,7 @@ function launchGanttEditor(debug){
senchaPreferenceStore: senchaPreferenceStore senchaPreferenceStore: senchaPreferenceStore
}); });
ganttZoomController.init(this); ganttZoomController.init(this);
resizeController.ganttZoomController = ganttZoomController;
// Create the panel showing properties of a task, but don't show it yet. // Create the panel showing properties of a task, but don't show it yet.
var taskPropertyPanel = Ext.create("PO.view.gantt.GanttTaskPropertyPanel", { var taskPropertyPanel = Ext.create("PO.view.gantt.GanttTaskPropertyPanel", {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
Ext.define('GanttEditor.controller.GanttZoomController', { Ext.define('GanttEditor.controller.GanttZoomController', {
extend: 'Ext.app.Controller', extend: 'Ext.app.Controller',
id: 'ganttZoomController',
refs: [ refs: [
{ref: 'ganttBarPanel', selector: '#ganttBarPanel'}, {ref: 'ganttBarPanel', selector: '#ganttBarPanel'},
{ref: 'ganttTreePanel', selector: '#ganttTreePanel'} {ref: 'ganttTreePanel', selector: '#ganttTreePanel'}
...@@ -239,8 +240,36 @@ Ext.define('GanttEditor.controller.GanttZoomController', { ...@@ -239,8 +240,36 @@ Ext.define('GanttEditor.controller.GanttZoomController', {
} }
if (me.debug) console.log('GanttEditor.controller.GanttZoomController.onButtonZoomCenter: Finished'); if (me.debug) console.log('GanttEditor.controller.GanttZoomController.onButtonZoomCenter: Finished');
} },
/**
* Somebody pressed the "Fullscreen" button...
* This function is called by the ResizeController.
*/
onSwitchToFullScreen: function () {
var me = this;
if (me.debug) console.log('GanttEditor.controller.GanttZoomController.onSwitchToFullScreen: Starting');
var ganttBarPanel = me.getGanttBarPanel();
var panelBox = ganttBarPanel.getBox();
var panelWidth = panelBox.width;
var panelHeight = panelBox.height;
var surfaceWidth = ganttBarPanel.axisEndX;
if (surfaceWidth < panelWidth) {
ganttBarPanel.axisEndX = panelWidth;
ganttBarPanel.surface.setSize(panelWidth,panelHeight);
// persist the changes
me.senchaPreferenceStore.setPreference('axisEndX', ganttBarPanel.axisEndX);
me.senchaPreferenceStore.setPreference('scrollX', 0);
ganttBarPanel.needsRedraw = true; // request a redraw
}
if (me.debug) console.log('GanttEditor.controller.GanttZoomController.onSwitchToFullScreen: Finished');
}
}); });
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