Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2-weekly
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-weekly
Commits
a35a86c9
Commit
a35a86c9
authored
Apr 02, 2021
by
Project Open
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Moved HourWeeklyController to separate file, added standard ResizeController
parent
d117ee8d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
47 deletions
+22
-47
index.adp
www/index.adp
+22
-3
HourWeeklyController.js.adp
www/js/HourWeeklyController.js.adp
+0
-44
No files found.
www/index.adp
View file @
a35a86c9
...
...
@@ -26,12 +26,13 @@ Ext.require([
'Ext.grid.*',
'Ext.tree.*',
'PO.Utilities',
'PO.store.CategoryStore',
'PO.store.project.ProjectMainStore',
'PO.controller.ResizeController', // Handles "Maximize" button etc.
'PO.controller.StoreLoadCoordinator',
'PO.model.timesheet.TimesheetTask',
'PO.model.timesheet.Hour',
'PO.model.project.Project',
'PO.store.CategoryStore',
'PO.store.project.ProjectMainStore',
'PO.store.timesheet.HourStore',
'PO.store.timesheet.TaskTreeStore',
'PO.view.field.POComboTree'
...
...
@@ -255,6 +256,24 @@ function launchTimesheetWeeklyLogging(){
hourController.init(this).onLaunch(this);
hourGrid.hourController = hourController; // Add reference to hourGrid
// Controller to handle size and resizing related events
var renderDiv = Ext.get("@task_editor_id@");
var resizeController = Ext.create('PO.controller.ResizeController', {
debug: getDebug('resizeController'),
redrawPanel: hourButtonPanel, // panel with redraw() function and needsRedraw variable
renderDiv: renderDiv, // container of outerContainer
outerContainer: hourButtonPanel // outermost panel with resize border
}).init();
resizeController.onLaunch(this);
resizeController.onResize(); // Set the size of the outer GanttButton Panel
// Testing events
hourButtonPanel.fireEvent('keypress');
...
...
www/js/HourWeeklyController.js.adp
View file @
a35a86c9
...
...
@@ -231,50 +231,6 @@ Ext.define('PO.tsweekly.HourWeeklyController', {
var keyCode = e.getKey();
var keyCtrl = e.ctrlKey;
console.log('GanttButtonController.onCellKeyDown: code='+keyCode+', ctrl='+keyCtrl);
},
/**
* The windows as a whole was resized
*/
onWindowsResize: function(width, height) {
console.log('GanttButtonController.onWindowResize');
var me = this;
var sideBar = Ext.get('sidebar'); // ]po[ left side bar component
var sideBarSize = sideBar.getSize();
me.onResize(sideBarSize.width);
},
/**
* The ]po[ left sideBar was resized
*/
onSideBarResize: function(event, el, config) {
console.log('GanttButtonController.onSideBarResize');
var me = this;
var sideBar = Ext.get('sidebar'); // ]po[ left side bar component
var sideBarSize = sideBar.getSize();
// We get the event _before_ the sideBar has changed it's size.
// So we actually need to the the oposite of the sidebar size:
if (sideBarSize.width > 100) {
sideBarSize.width = -5;
} else {
sideBarSize.width = 245;
}
me.onResize(sideBarSize.width);
},
/**
* Generic resizing function, called with the target width of the sideBar
*/
onResize: function(sideBarWidth) {
console.log('GanttButtonController.onResize: '+sideBarWidth);
var me = this;
var screenSize = Ext.getBody().getViewSize();
var height = me.hourButtonPanel.getSize().height;
var width = screenSize.width - sideBarWidth - 75;
me.hourButtonPanel.setSize(width, height);
}
});
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