Bug Tracker

Modify

Ticket #3127 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

File size optimizations for jQuery.event.special

Reported by: mike.helgeson Owned by: flesler
Priority: minor Milestone: 1.3
Component: event Version: 1.2.6
Keywords: Cc:
Blocking: Blocked by:

Description


Attachments

hover[5762].diff Download (2.4 KB) - added by flesler 5 years ago.
My proposal (349 bytes)
hover-mike[5762].diff Download (2.4 KB) - added by flesler 5 years ago.
Mike's proposal (378 bytes)
enterleave_patch.js Download (1005 bytes) - added by mike.helgeson 5 years ago.
new hybrid from both versions

Change History

Changed 5 years ago by flesler

My proposal (349 bytes)

Changed 5 years ago by flesler

Mike's proposal (378 bytes)

comment:1 Changed 5 years ago by flesler

  • need changed from Patch to Commit
  • Status changed from new to assigned

Both patches include the removal of 2 needless "return;".

The amount of bytes is calculated after minifying with Dean's Packer, having the name munging option on.

My proposal is inspired on Mike's. It slightly modifies the behavior, as no special event is created for IE and the handler isn't exposed. Overall, it will work faster and takes less code.

Still... could be better to skip some of the optimizations. Opinions ?

Changed 5 years ago by mike.helgeson

new hybrid from both versions

comment:2 Changed 5 years ago by mike.helgeso

Hybrid version for expands further on Ariels changes... It makes the withinElement function the actual handler, which is shared by both events (and not exposed). This version is not aggressive with variable references because I think "minifying" does not munge variable names, it just removes comments and whitespace.

comment:3 Changed 5 years ago by flesler

  • Status changed from assigned to closed
  • Resolution set to fixed

Applied yours at [5797] only with slight modifications.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.