Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-gantt-editor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-gantt-editor
Commits
9aadc669
Commit
9aadc669
authored
Dec 18, 2020
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added < and > options to move the timeline
- Fixed issue with wrong week numbers
parent
0a780609
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
2 deletions
+62
-2
gantt-editor.adp
lib/gantt-editor.adp
+3
-1
GanttZoomController.js
www/controller/GanttZoomController.js
+59
-1
No files found.
lib/gantt-editor.adp
View file @
9aadc669
...
...
@@ -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}
...
...
www/controller/GanttZoomController.js
View file @
9aadc669
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment