Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2-interval
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-timesheet2-interval
Commits
b0b564e6
Commit
b0b564e6
authored
Jul 28, 2014
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Timesheet Intervals:
Added Esc key to abort current logging
parent
016bb01e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
4 deletions
+60
-4
timesheet-interval.adp
lib/timesheet-interval.adp
+60
-4
No files found.
lib/timesheet-interval.adp
View file @
b0b564e6
...
@@ -117,23 +117,26 @@ function launchTreePanel(){
...
@@ -117,23 +117,26 @@ function launchTreePanel(){
tooltip: 'Stop logging',
tooltip: 'Stop logging',
id: 'buttonStopLogging',
id: 'buttonStopLogging',
disabled: true
disabled: true
}, {
icon: '/intranet/images/navbar_default/clock_delete.png',
tooltip: 'Cancel logging',
id: 'buttonCancelLogging',
disabled: true
}]
}]
});
});
// Use the button panel as a container for the task tree and the hour grid
// Use the button panel as a container for the task tree and the hour grid
var hourIntervalButtonPanel = Ext.create('PO.view.timesheet.HourIntervalButtonPanel', {
var hourIntervalButtonPanel = Ext.create('PO.view.timesheet.HourIntervalButtonPanel', {
renderTo: '@task_editor_id@',
width: width,
width: width,
height: height,
height: height,
resizable: true, // Add handles to the panel, so the user can change size
resizable: true, // Add handles to the panel, so the user can change size
items: [
items: [
hourIntervalGrid,
hourIntervalGrid,
ganttTreePanel
ganttTreePanel
],
]
renderTo: '@task_editor_id@'
});
});
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// Controller for interaction between Tree and Grid
// Controller for interaction between Tree and Grid
//
//
...
@@ -164,6 +167,7 @@ function launchTreePanel(){
...
@@ -164,6 +167,7 @@ function launchTreePanel(){
this.control({
this.control({
'#buttonStartLogging': { click: this.onButtonStartLogging },
'#buttonStartLogging': { click: this.onButtonStartLogging },
'#buttonStopLogging': { click: this.onButtonStopLogging },
'#buttonStopLogging': { click: this.onButtonStopLogging },
'#buttonCancelLogging': { click: this.onButtonCancelLogging },
scope: me.ganttTreePanel
scope: me.ganttTreePanel
});
});
...
@@ -173,9 +177,21 @@ function launchTreePanel(){
...
@@ -173,9 +177,21 @@ function launchTreePanel(){
// Listen to a click into the empty space below the grid entries in order to start creating a new entry
// Listen to a click into the empty space below the grid entries in order to start creating a new entry
me.hourIntervalGrid.on('containerclick', this.onGridContainerClick, me);
me.hourIntervalGrid.on('containerclick', this.onGridContainerClick, me);
// Catch a global Esc button in order to abort logging
// For some reaons this doesn't work on the level of the HourButtonPanel, so
// we go for the global "window" here.
Ext.EventManager.on(window, 'keydown', this.onKeyEsc, me);
return this;
return this;
},
},
// Esc (Escape) button pressed somewhere in the application window
onKeyEsc: function() {
console.log('GanttButtonController.onKeyEsc');
this.onButtonCancelLogging();
},
// Click into the empty space below the grid entries in order to start creating a new entry
// Click into the empty space below the grid entries in order to start creating a new entry
onGridContainerClick: function() {
onGridContainerClick: function() {
console.log('GanttButtonController.GridContainerClick');
console.log('GanttButtonController.GridContainerClick');
...
@@ -195,8 +211,10 @@ function launchTreePanel(){
...
@@ -195,8 +211,10 @@ function launchTreePanel(){
console.log('GanttButtonController.ButtonStartLogging');
console.log('GanttButtonController.ButtonStartLogging');
var buttonStartLogging = Ext.getCmp('buttonStartLogging');
var buttonStartLogging = Ext.getCmp('buttonStartLogging');
var buttonStopLogging = Ext.getCmp('buttonStopLogging');
var buttonStopLogging = Ext.getCmp('buttonStopLogging');
var buttonCancelLogging = Ext.getCmp('buttonCancelLogging');
buttonStartLogging.disable();
buttonStartLogging.disable();
buttonStopLogging.enable();
buttonStopLogging.enable();
buttonCancelLogging.enable();
rowEditing.cancelEdit();
rowEditing.cancelEdit();
...
@@ -223,8 +241,10 @@ function launchTreePanel(){
...
@@ -223,8 +241,10 @@ function launchTreePanel(){
console.log('GanttButtonController.ButtonStopLogging');
console.log('GanttButtonController.ButtonStopLogging');
var buttonStartLogging = Ext.getCmp('buttonStartLogging');
var buttonStartLogging = Ext.getCmp('buttonStartLogging');
var buttonStopLogging = Ext.getCmp('buttonStopLogging');
var buttonStopLogging = Ext.getCmp('buttonStopLogging');
var buttonCancelLogging = Ext.getCmp('buttonCancelLogging');
buttonStartLogging.enable();
buttonStartLogging.enable();
buttonStopLogging.disable();
buttonStopLogging.disable();
buttonCancelLogging.disable();
// Complete the hourInterval created when starting to log
// Complete the hourInterval created when starting to log
this.loggingInterval.set('interval_end', new Date());
this.loggingInterval.set('interval_end', new Date());
...
@@ -238,6 +258,24 @@ function launchTreePanel(){
...
@@ -238,6 +258,24 @@ function launchTreePanel(){
this.loggingStartTime = null;
this.loggingStartTime = null;
},
},
onButtonCancelLogging: function() {
console.log('GanttButtonController.ButtonCancelLogging');
var buttonStartLogging = Ext.getCmp('buttonStartLogging');
var buttonStopLogging = Ext.getCmp('buttonStopLogging');
var buttonCancelLogging = Ext.getCmp('buttonCancelLogging');
buttonStartLogging.enable();
buttonStopLogging.disable();
buttonCancelLogging.disable();
// Delete the started line
rowEditing.cancelEdit();
hourIntervalStore.remove(this.loggingInterval);
// Stop logging
this.loggingTask = null;
this.loggingStartTime = null;
},
/**
/**
* Control the enabled/disabled status of the Start/Stop logging buttons
* Control the enabled/disabled status of the Start/Stop logging buttons
*/
*/
...
@@ -269,6 +307,18 @@ function launchTreePanel(){
...
@@ -269,6 +307,18 @@ function launchTreePanel(){
}
}
},
},
/**
* Handle various key actions
*/
onCellKeyDown: function(table, htmlTd, cellIndex, record, htmlTr, rowIndex, e, eOpts) {
console.log('GanttButtonController.onCellKeyDown');
var keyCode = e.getKey();
var keyCtrl = e.ctrlKey;
console.log('GanttButtonController.onCellKeyDown: code='+keyCode+', ctrl='+keyCtrl);
},
/**
/**
* The windows as a whole was resized
* The windows as a whole was resized
*/
*/
...
@@ -314,6 +364,7 @@ function launchTreePanel(){
...
@@ -314,6 +364,7 @@ function launchTreePanel(){
});
});
var sideBarTab = Ext.get('sideBarTab');
var sideBarTab = Ext.get('sideBarTab');
var hourIntervalController = Ext.create('PO.controller.timesheet.HourIntervalController', {
var hourIntervalController = Ext.create('PO.controller.timesheet.HourIntervalController', {
'hourIntervalButtonPanel': hourIntervalButtonPanel,
'hourIntervalButtonPanel': hourIntervalButtonPanel,
...
@@ -323,6 +374,11 @@ function launchTreePanel(){
...
@@ -323,6 +374,11 @@ function launchTreePanel(){
});
});
hourIntervalController.init(this).onLaunch(this);
hourIntervalController.init(this).onLaunch(this);
// Testing events
hourIntervalButtonPanel.fireEvent('keypress');
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// Handle collapsable side menu
// Handle collapsable side menu
sideBarTab.on('click', hourIntervalController.onSideBarResize, hourIntervalController);
sideBarTab.on('click', hourIntervalController.onSideBarResize, hourIntervalController);
...
...
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