Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
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
夏彬
jquery
Commits
97fa97f0
Commit
97fa97f0
authored
Dec 26, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove oldIE proprietary event methods/properties.
parent
1c429781
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
43 deletions
+9
-43
event.js
src/event.js
+9
-43
No files found.
src/event.js
View file @
97fa97f0
...
@@ -86,14 +86,10 @@ jQuery.event = {
...
@@ -86,14 +86,10 @@ jQuery.event = {
handlers
=
events
[
type
]
=
[];
handlers
=
events
[
type
]
=
[];
handlers
.
delegateCount
=
0
;
handlers
.
delegateCount
=
0
;
// Only use addEventListener
/attachEvent
if the special events handler returns false
// Only use addEventListener if the special events handler returns false
if
(
!
special
.
setup
||
special
.
setup
.
call
(
elem
,
data
,
namespaces
,
eventHandle
)
===
false
)
{
if
(
!
special
.
setup
||
special
.
setup
.
call
(
elem
,
data
,
namespaces
,
eventHandle
)
===
false
)
{
// Bind the global event handler to the element
if
(
elem
.
addEventListener
)
{
if
(
elem
.
addEventListener
)
{
elem
.
addEventListener
(
type
,
eventHandle
,
false
);
elem
.
addEventListener
(
type
,
eventHandle
,
false
);
}
else
if
(
elem
.
attachEvent
)
{
elem
.
attachEvent
(
"on"
+
type
,
eventHandle
);
}
}
}
}
}
}
...
@@ -580,26 +576,11 @@ jQuery.event = {
...
@@ -580,26 +576,11 @@ jQuery.event = {
// The 1.7 special event interface should provide all the hooks needed now.
// The 1.7 special event interface should provide all the hooks needed now.
jQuery
.
event
.
handle
=
jQuery
.
event
.
dispatch
;
jQuery
.
event
.
handle
=
jQuery
.
event
.
dispatch
;
jQuery
.
removeEvent
=
document
.
removeEventListener
?
jQuery
.
removeEvent
=
function
(
elem
,
type
,
handle
)
{
function
(
elem
,
type
,
handle
)
{
if
(
elem
.
removeEventListener
)
{
if
(
elem
.
removeEventListener
)
{
elem
.
removeEventListener
(
type
,
handle
,
false
);
elem
.
removeEventListener
(
type
,
handle
,
false
);
}
}
};
}
:
function
(
elem
,
type
,
handle
)
{
var
name
=
"on"
+
type
;
if
(
elem
.
detachEvent
)
{
// #8545, #7054, preventing memory leaks for custom events in IE6-8
// detachEvent needed property on element, by name of that event, to properly expose it to GC
if
(
typeof
elem
[
name
]
===
"undefined"
)
{
elem
[
name
]
=
null
;
}
elem
.
detachEvent
(
name
,
handle
);
}
};
jQuery
.
Event
=
function
(
src
,
props
)
{
jQuery
.
Event
=
function
(
src
,
props
)
{
// Allow instantiation without the 'new' keyword
// Allow instantiation without the 'new' keyword
...
@@ -614,7 +595,7 @@ jQuery.Event = function( src, props ) {
...
@@ -614,7 +595,7 @@ jQuery.Event = function( src, props ) {
// Events bubbling up the document may have been marked as prevented
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
// by a handler lower down the tree; reflect the correct value.
this
.
isDefaultPrevented
=
(
src
.
defaultPrevented
||
src
.
returnValue
===
false
||
this
.
isDefaultPrevented
=
(
src
.
defaultPrevented
||
src
.
getPreventDefault
&&
src
.
getPreventDefault
()
)
?
returnTrue
:
returnFalse
;
src
.
getPreventDefault
&&
src
.
getPreventDefault
()
)
?
returnTrue
:
returnFalse
;
// Event type
// Event type
...
@@ -648,32 +629,17 @@ jQuery.Event.prototype = {
...
@@ -648,32 +629,17 @@ jQuery.Event.prototype = {
this
.
isDefaultPrevented
=
returnTrue
;
this
.
isDefaultPrevented
=
returnTrue
;
var
e
=
this
.
originalEvent
;
var
e
=
this
.
originalEvent
;
if
(
!
e
)
{
if
(
e
&&
e
.
preventDefault
)
{
return
;
}
// if preventDefault exists run it on the original event
if
(
e
.
preventDefault
)
{
e
.
preventDefault
();
e
.
preventDefault
();
// otherwise set the returnValue property of the original event to false (IE)
}
else
{
e
.
returnValue
=
false
;
}
}
},
},
stopPropagation
:
function
()
{
stopPropagation
:
function
()
{
this
.
isPropagationStopped
=
returnTrue
;
this
.
isPropagationStopped
=
returnTrue
;
var
e
=
this
.
originalEvent
;
var
e
=
this
.
originalEvent
;
if
(
!
e
)
{
if
(
e
&&
e
.
stopPropagation
)
{
return
;
}
// if stopPropagation exists run it on the original event
if
(
e
.
stopPropagation
)
{
e
.
stopPropagation
();
e
.
stopPropagation
();
}
}
// otherwise set the cancelBubble property of the original event to true (IE)
e
.
cancelBubble
=
true
;
},
},
stopImmediatePropagation
:
function
()
{
stopImmediatePropagation
:
function
()
{
this
.
isImmediatePropagationStopped
=
returnTrue
;
this
.
isImmediatePropagationStopped
=
returnTrue
;
...
...
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