Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
63de0a58
Commit
63de0a58
authored
15 years ago
by
Adrian Lang
Browse files
Options
Downloads
Patches
Plain Diff
Fix pageX and pageY in IE’s JS events
parent
1410ed4b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/scripts/drag.js
+4
-18
4 additions, 18 deletions
lib/scripts/drag.js
lib/scripts/events.js
+4
-0
4 additions, 0 deletions
lib/scripts/events.js
with
8 additions
and
18 deletions
lib/scripts/drag.js
+
4
−
18
View file @
63de0a58
...
...
@@ -50,8 +50,8 @@ var drag = {
this
.
oX
=
parseInt
(
this
.
obj
.
style
.
left
);
this
.
oY
=
parseInt
(
this
.
obj
.
style
.
top
);
this
.
eX
=
drag
.
evX
(
e
)
;
this
.
eY
=
drag
.
evY
(
e
)
;
this
.
eX
=
e
.
pageX
;
this
.
eY
=
e
.
pageY
;
var
_this
=
this
;
this
.
mousehandlers
=
[
function
(
e
)
{
return
_this
.
drag
(
e
);},
function
(
e
)
{
return
_this
.
stop
(
e
);}];
...
...
@@ -80,23 +80,9 @@ var drag = {
*/
drag
:
function
(
e
)
{
if
(
this
.
obj
)
{
this
.
obj
.
style
.
top
=
(
this
.
evY
(
e
)
+
this
.
oY
-
this
.
eY
+
'
px
'
);
this
.
obj
.
style
.
left
=
(
this
.
evX
(
e
)
+
this
.
oX
-
this
.
eX
+
'
px
'
);
this
.
obj
.
style
.
top
=
(
e
.
pageY
+
this
.
oY
-
this
.
eY
+
'
px
'
);
this
.
obj
.
style
.
left
=
(
e
.
pageX
+
this
.
oX
-
this
.
eX
+
'
px
'
);
}
},
/**
* Returns the X position of the given event.
*/
evX
:
function
(
e
){
return
(
e
.
pageX
)
?
e
.
pageX
:
e
.
clientX
+
document
.
body
.
scrollTop
;
//fixme shouldn't this be scrollLeft?
},
/**
* Returns the Y position of the given event.
*/
evY
:
function
(
e
){
return
(
e
.
pageY
)
?
e
.
pageY
:
e
.
clientY
+
document
.
body
.
scrollTop
;
}
};
This diff is collapsed.
Click to expand it.
lib/scripts/events.js
+
4
−
0
View file @
63de0a58
...
...
@@ -55,6 +55,10 @@ function fixEvent(event) {
event
.
stopPropagation
=
fixEvent
.
stopPropagation
;
// fix target
event
.
target
=
event
.
srcElement
;
// fix coords
event
.
pageX
=
(
typeof
event
.
pageX
!==
'
undefined
'
)
?
event
.
pageX
:
event
.
clientX
+
document
.
body
.
scrollTop
;
event
.
pageY
=
(
typeof
event
.
pageY
!==
'
undefined
'
)
?
event
.
pageY
:
event
.
clientY
+
document
.
body
.
scrollTop
;
return
event
;
};
fixEvent
.
preventDefault
=
function
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment