Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
noVNC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
cdn
noVNC
Commits
a0e3ec0a
Commit
a0e3ec0a
authored
8 years ago
by
Samuel Mannehed
Browse files
Options
Downloads
Patches
Plain Diff
Stop using window.event
It's an old propriatary IE thing that isn't necessary.
parent
af1b2ae1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/input/devices.js
+13
-17
13 additions, 17 deletions
core/input/devices.js
core/util.js
+1
-4
1 addition, 4 deletions
core/util.js
with
14 additions
and
21 deletions
core/input/devices.js
+
13
−
17
View file @
a0e3ec0a
...
...
@@ -213,8 +213,7 @@
this
.
_notify
(
e
);
}
var
evt
=
(
e
?
e
:
window
.
event
);
var
pos
=
this
.
_getMousePosition
(
evt
);
var
pos
=
this
.
_getMousePosition
(
e
);
var
bmask
;
if
(
e
.
touches
||
e
.
changedTouches
)
{
...
...
@@ -247,14 +246,14 @@
}
bmask
=
this
.
_touchButton
;
// If bmask is set
}
else
if
(
e
vt
.
which
)
{
}
else
if
(
e
.
which
)
{
/* everything except IE */
bmask
=
1
<<
e
vt
.
button
;
bmask
=
1
<<
e
.
button
;
}
else
{
/* IE including 9 */
bmask
=
(
e
vt
.
button
&
0x1
)
+
// Left
(
e
vt
.
button
&
0x2
)
*
2
+
// Right
(
e
vt
.
button
&
0x4
)
/
2
;
// Middle
bmask
=
(
e
.
button
&
0x1
)
+
// Left
(
e
.
button
&
0x2
)
*
2
+
// Right
(
e
.
button
&
0x4
)
/
2
;
// Middle
}
if
(
this
.
_onMouseButton
)
{
...
...
@@ -285,22 +284,21 @@
this
.
_notify
(
e
);
}
var
evt
=
(
e
?
e
:
window
.
event
);
var
pos
=
this
.
_getMousePosition
(
evt
);
var
pos
=
this
.
_getMousePosition
(
e
);
if
(
this
.
_onMouseButton
)
{
if
(
e
vt
.
deltaX
<
0
)
{
if
(
e
.
deltaX
<
0
)
{
this
.
_onMouseButton
(
pos
.
x
,
pos
.
y
,
1
,
1
<<
5
);
this
.
_onMouseButton
(
pos
.
x
,
pos
.
y
,
0
,
1
<<
5
);
}
else
if
(
e
vt
.
deltaX
>
0
)
{
}
else
if
(
e
.
deltaX
>
0
)
{
this
.
_onMouseButton
(
pos
.
x
,
pos
.
y
,
1
,
1
<<
6
);
this
.
_onMouseButton
(
pos
.
x
,
pos
.
y
,
0
,
1
<<
6
);
}
if
(
e
vt
.
deltaY
<
0
)
{
if
(
e
.
deltaY
<
0
)
{
this
.
_onMouseButton
(
pos
.
x
,
pos
.
y
,
1
,
1
<<
3
);
this
.
_onMouseButton
(
pos
.
x
,
pos
.
y
,
0
,
1
<<
3
);
}
else
if
(
e
vt
.
deltaY
>
0
)
{
}
else
if
(
e
.
deltaY
>
0
)
{
this
.
_onMouseButton
(
pos
.
x
,
pos
.
y
,
1
,
1
<<
4
);
this
.
_onMouseButton
(
pos
.
x
,
pos
.
y
,
0
,
1
<<
4
);
}
...
...
@@ -317,8 +315,7 @@
this
.
_notify
(
e
);
}
var
evt
=
(
e
?
e
:
window
.
event
);
var
pos
=
this
.
_getMousePosition
(
evt
);
var
pos
=
this
.
_getMousePosition
(
e
);
if
(
this
.
_onMouseMove
)
{
this
.
_onMouseMove
(
pos
.
x
,
pos
.
y
);
}
...
...
@@ -329,14 +326,13 @@
_handleMouseDisable
:
function
(
e
)
{
if
(
!
this
.
_focused
)
{
return
true
;
}
var
evt
=
(
e
?
e
:
window
.
event
);
/*
* Stop propagation if inside canvas area
* Note: This is only needed for the 'click' event as it fails
* to fire properly for the target element so we have
* to listen on the document element instead.
*/
if
(
e
vt
.
target
==
this
.
_target
)
{
if
(
e
.
target
==
this
.
_target
)
{
//Util.Debug("mouse event disabled");
Util
.
stopEvent
(
e
);
return
false
;
...
...
This diff is collapsed.
Click to expand it.
core/util.js
+
1
−
4
View file @
a0e3ec0a
...
...
@@ -195,10 +195,7 @@ Util.decodeUTF8 = function (utf8string) {
*/
Util
.
getPointerEvent
=
function
(
e
)
{
var
evt
;
evt
=
(
e
?
e
:
window
.
event
);
evt
=
(
evt
.
changedTouches
?
evt
.
changedTouches
[
0
]
:
evt
.
touches
?
evt
.
touches
[
0
]
:
evt
);
return
evt
;
return
e
.
changedTouches
?
e
.
changedTouches
[
0
]
:
e
.
touches
?
e
.
touches
[
0
]
:
e
;
};
Util
.
stopEvent
=
function
(
e
)
{
...
...
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