jQuery: The Write Less, Do More JavaScript Library

Ticket #1923 (closed enhancement: fixed)

Opened 9 months ago

Last modified 9 months ago

shadow enhancements, optimizations and clean-ups

Reported by: brandon Assigned to: paul
Type: enhancement Priority: major
Milestone: 1.2.2 Component: ui
Version: 1.2.1 Keywords:
Cc: Needs: Commit

Description (last modified by brandon) (diff)

I've attached a diff that includes a few optimizations, enhancements and general clean-ups of the code.

  • Saved bytes where possible
  • Renamed some variables to better match jQuery standards
  • Used jQuery.extend to map options
  • Reduced the number of calls to css
  • Removed browser detection
  • Added monitor option which defaults to false. Monitoring the element to keep the shadow in-tact is buggy and not cross browser. We shouldn't do it by default until there is better support.
  • The shadow method can be called multiple times on the same element to "rebuild" the shadow if the element has changed and is not being monitored.
  • The offset now matches the value passed in

BTW ... the test page is using and xml prologue which is throwing IE into quirks mode and is why the position _looks_ to be miscalculated. Putting the test page in standards mode resolves this issue but causes issues for the drag handles.

The monitoring in Opera does some pretty crazy stuff!

Tested using the test page in IE 6 and 7, FF 1.5 and 2, Safari 3 and Opera 9.24

Attachments

fx.shadow.js.diff (7.0 kB) - added by brandon 9 months ago.
fx.shadow.js.2.diff (7.2 kB) - added by brandon 9 months ago.

Change History

Changed 9 months ago by brandon

Changed 9 months ago by brandon

This should also resolve #1808

Changed 9 months ago by brandon

Changed 9 months ago by brandon

Updated patch to include a shadowDestroy method and use currentStyle in IE expressions.

Changed 9 months ago by brandon

  • status changed from new to closed
  • resolution set to fixed
  • description changed from I've attached a diff that includes a few optimizations, enhancements and general clean-ups of the code. * Saved bytes where possible * Renamed some variables to better match jQuery standards * Used jQuery.extend to map options * Reduced the number of calls to css * Removed browser detection * Added monitor option which defaults to false. Monitoring the element to keep the shadow in-tact is buggy and not cross browser. We shouldn't do it by default until there is better support. * The shadow method can be called multiple times on the same element to "rebuild" the shadow if the element has changed and is not being monitored. * The offset now matches the value passed in BTW ... the test page is using and xml prologue which is throwing IE into quirks mode and is why the position _looks_ to be miscalculated. Putting the test page in standards mode resolves this issue but causes issues for the drag handles. The monitoring in Opera does some pretty crazy stuff! Tested using the test page in IE 6 and 7, FF 1.5 and 2, Safari 3 and Opera 9.24 to I've attached a diff that includes a few optimizations, enhancements and general clean-ups of the code. * Saved bytes where possible * Renamed some variables to better match jQuery standards * Used jQuery.extend to map options * Reduced the number of calls to css * Removed browser detection * Added monitor option which defaults to false. Monitoring the element to keep the shadow in-tact is buggy and not cross browser. We shouldn't do it by default until there is better support. * The shadow method can be called multiple times on the same element to "rebuild" the shadow if the element has changed and is not being monitored. * The offset now matches the value passed in BTW ... the test page is using and xml prologue which is throwing IE into quirks mode and is why the position _looks_ to be miscalculated. Putting the test page in standards mode resolves this issue but causes issues for the drag handles. The monitoring in Opera does some pretty crazy stuff! Tested using the test page in IE 6 and 7, FF 1.5 and 2, Safari 3 and Opera 9.24

Fixed in Rev [3823]

Note: See TracTickets for help on using tickets.