mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Data: move element cache to element[expando]
- avoid explicit data.discard() cleanup calls - explicitly remove the data.events property, only when private data exists - reduces code footprint Fixes gh-1734 Close gh-1428
This commit is contained in:
committed by
Timmy Willison
parent
95fb798980
commit
d702b7637a
@@ -216,8 +216,12 @@ jQuery.event = {
|
||||
|
||||
// Remove the expando if it's no longer used
|
||||
if ( jQuery.isEmptyObject( events ) ) {
|
||||
// Normally this should go through the data api
|
||||
// but since event.js owns these properties,
|
||||
// this exception is made for the sake of optimizing
|
||||
// the operation.
|
||||
delete elemData.handle;
|
||||
dataPriv.remove( elem, "events" );
|
||||
delete elemData.events;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user