Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sencha-core
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
sencha-core
Commits
13b8034a
Commit
13b8034a
authored
Jun 27, 2015
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- GanttEditor:
Working on DnD for size and %done
parent
2ee018f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
AbstractGanttPanel.js
www/view/gantt/AbstractGanttPanel.js
+10
-7
No files found.
www/view/gantt/AbstractGanttPanel.js
View file @
13b8034a
...
...
@@ -109,9 +109,10 @@ Ext.define('PO.view.gantt.AbstractGanttPanel', {
// Now using offsetX/offsetY instead of getXY()
var
point
=
me
.
getMousePoint
(
e
);
var
baseSprite
=
me
.
getSpriteForPoint
(
point
);
console
.
log
(
'PO.view.gantt.AbstractGanttPanel.onMouseDown: '
+
point
+
' -> '
+
baseSprite
);
if
(
baseSprite
==
null
)
{
return
;
}
var
baseSprites
=
me
.
getSpriteForPoint
(
point
);
console
.
log
(
'PO.view.gantt.AbstractGanttPanel.onMouseDown: '
+
point
+
' -> '
+
baseSprites
);
if
(
0
==
baseSprites
.
length
)
{
return
;
}
var
baseSprite
=
baseSprites
[
0
];
if
(
e
.
button
==
2
)
{
// Right-click on sprite
...
...
@@ -169,7 +170,9 @@ Ext.define('PO.view.gantt.AbstractGanttPanel', {
console
.
log
(
'PO.view.gantt.AbstractGanttPanel.onMouseUp: '
+
point
);
// Check where the user has dropped the mouse
var
dropSprite
=
me
.
getSpriteForPoint
(
point
);
var
dropSprites
=
me
.
getSpriteForPoint
(
point
);
var
dropSprite
=
null
;
if
(
dropSprites
.
length
>
0
)
{
dropSprite
=
dropSprites
[
0
];
}
if
(
dropSprite
==
me
.
dndBaseSprite
)
{
dropSprite
=
null
;
}
// Dropped on the same sprite? => normal drop
// Reset the offset when just clicking
...
...
@@ -192,7 +195,7 @@ Ext.define('PO.view.gantt.AbstractGanttPanel', {
},
/**
* Returns
the item
for a x/y mouse coordinate
* Returns
a list of sprites
for a x/y mouse coordinate
*/
getSpriteForPoint
:
function
(
point
)
{
var
me
=
this
,
...
...
@@ -213,10 +216,10 @@ Ext.define('PO.view.gantt.AbstractGanttPanel', {
if
(
bbox
.
x
+
bbox
.
width
<
x
)
continue
;
if
(
bbox
.
y
+
bbox
.
height
<
y
)
continue
;
re
turn
sprite
;
re
sult
.
push
(
sprite
)
;
}
return
null
;
return
result
;
},
/**
...
...
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