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
1c429781
Commit
1c429781
authored
Dec 26, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove oldIE change and submit special-event code.
parent
861a45b8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
108 deletions
+1
-108
event.js
src/event.js
+1
-108
No files found.
src/event.js
View file @
1c429781
var
rformElems
=
/^
(?:
input|select|textarea
)
$/i
,
var
rkeyEvent
=
/^key/
,
rkeyEvent
=
/^key/
,
rmouseEvent
=
/^
(?:
mouse|contextmenu
)
|click/
,
rmouseEvent
=
/^
(?:
mouse|contextmenu
)
|click/
,
rfocusMorph
=
/^
(?:
focusinfocus|focusoutblur
)
$/
,
rfocusMorph
=
/^
(?:
focusinfocus|focusoutblur
)
$/
,
rtypenamespace
=
/^
([^
.
]
*
)(?:\.(
.+
)
|
)
$/
;
rtypenamespace
=
/^
([^
.
]
*
)(?:\.(
.+
)
|
)
$/
;
...
@@ -712,112 +711,6 @@ jQuery.each({
...
@@ -712,112 +711,6 @@ jQuery.each({
};
};
});
});
// IE submit delegation
if
(
!
jQuery
.
support
.
submitBubbles
)
{
jQuery
.
event
.
special
.
submit
=
{
setup
:
function
()
{
// Only need this for delegated form submit events
if
(
jQuery
.
nodeName
(
this
,
"form"
)
)
{
return
false
;
}
// Lazy-add a submit handler when a descendant form may potentially be submitted
jQuery
.
event
.
add
(
this
,
"click._submit keypress._submit"
,
function
(
e
)
{
// Node name check avoids a VML-related crash in IE (#9807)
var
elem
=
e
.
target
,
form
=
jQuery
.
nodeName
(
elem
,
"input"
)
||
jQuery
.
nodeName
(
elem
,
"button"
)
?
elem
.
form
:
undefined
;
if
(
form
&&
!
jQuery
.
_data
(
form
,
"_submit_attached"
)
)
{
jQuery
.
event
.
add
(
form
,
"submit._submit"
,
function
(
event
)
{
event
.
_submit_bubble
=
true
;
});
jQuery
.
_data
(
form
,
"_submit_attached"
,
true
);
}
});
// return undefined since we don't need an event listener
},
postDispatch
:
function
(
event
)
{
// If form was submitted by the user, bubble the event up the tree
if
(
event
.
_submit_bubble
)
{
delete
event
.
_submit_bubble
;
if
(
this
.
parentNode
&&
!
event
.
isTrigger
)
{
jQuery
.
event
.
simulate
(
"submit"
,
this
.
parentNode
,
event
,
true
);
}
}
},
teardown
:
function
()
{
// Only need this for delegated form submit events
if
(
jQuery
.
nodeName
(
this
,
"form"
)
)
{
return
false
;
}
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
jQuery
.
event
.
remove
(
this
,
"._submit"
);
}
};
}
// IE change delegation and checkbox/radio fix
if
(
!
jQuery
.
support
.
changeBubbles
)
{
jQuery
.
event
.
special
.
change
=
{
setup
:
function
()
{
if
(
rformElems
.
test
(
this
.
nodeName
)
)
{
// IE doesn't fire change on a check/radio until blur; trigger it on click
// after a propertychange. Eat the blur-change in special.change.handle.
// This still fires onchange a second time for check/radio after blur.
if
(
this
.
type
===
"checkbox"
||
this
.
type
===
"radio"
)
{
jQuery
.
event
.
add
(
this
,
"propertychange._change"
,
function
(
event
)
{
if
(
event
.
originalEvent
.
propertyName
===
"checked"
)
{
this
.
_just_changed
=
true
;
}
});
jQuery
.
event
.
add
(
this
,
"click._change"
,
function
(
event
)
{
if
(
this
.
_just_changed
&&
!
event
.
isTrigger
)
{
this
.
_just_changed
=
false
;
}
// Allow triggered, simulated change events (#11500)
jQuery
.
event
.
simulate
(
"change"
,
this
,
event
,
true
);
});
}
return
false
;
}
// Delegated event; lazy-add a change handler on descendant inputs
jQuery
.
event
.
add
(
this
,
"beforeactivate._change"
,
function
(
e
)
{
var
elem
=
e
.
target
;
if
(
rformElems
.
test
(
elem
.
nodeName
)
&&
!
jQuery
.
_data
(
elem
,
"_change_attached"
)
)
{
jQuery
.
event
.
add
(
elem
,
"change._change"
,
function
(
event
)
{
if
(
this
.
parentNode
&&
!
event
.
isSimulated
&&
!
event
.
isTrigger
)
{
jQuery
.
event
.
simulate
(
"change"
,
this
.
parentNode
,
event
,
true
);
}
});
jQuery
.
_data
(
elem
,
"_change_attached"
,
true
);
}
});
},
handle
:
function
(
event
)
{
var
elem
=
event
.
target
;
// Swallow native change events from checkbox/radio, we already triggered them above
if
(
this
!==
elem
||
event
.
isSimulated
||
event
.
isTrigger
||
(
elem
.
type
!==
"radio"
&&
elem
.
type
!==
"checkbox"
)
)
{
return
event
.
handleObj
.
handler
.
apply
(
this
,
arguments
);
}
},
teardown
:
function
()
{
jQuery
.
event
.
remove
(
this
,
"._change"
);
return
!
rformElems
.
test
(
this
.
nodeName
);
}
};
}
// Create "bubbling" focus and blur events
// Create "bubbling" focus and blur events
if
(
!
jQuery
.
support
.
focusinBubbles
)
{
if
(
!
jQuery
.
support
.
focusinBubbles
)
{
jQuery
.
each
({
focus
:
"focusin"
,
blur
:
"focusout"
},
function
(
orig
,
fix
)
{
jQuery
.
each
({
focus
:
"focusin"
,
blur
:
"focusout"
},
function
(
orig
,
fix
)
{
...
...
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