Ticket #91 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

LegendImage makes my CPU melt if Ext.BLANK_IMAGE_URL is not found

Reported by: tschaub Assigned to:
Priority: major Milestone: 0.5
Component: GeoExt.LegendImage Version: SVN
Keywords: Cc:
State: None

Description

If you happen to misspell the path to your Ext.BLANK_IMAGE_URL, the onImageLoadError listener in LegendImage.js will execute until FireFox fries.

Attachments

legend.patch (5.6 kB) - added by tschaub on 06/12/09 21:28:24.
handle image errors

Change History

06/12/09 21:28:24 changed by tschaub

  • attachment legend.patch added.

handle image errors

06/12/09 21:34:44 changed by tschaub

  • owner changed.
  • state changed from None to Review.
  • component changed from widgets to widgets.LegendImage.

What this patch does:

  • Allows for setting the default image src via config. If not set, Ext.BLANK_IMAGE_URL is used.
  • The autoEl is originally created with the defaultImgSrc. When the legend is rendered, we set the src to the user provided url. This allows registration of error handler before image src is set.
  • The setUrl method sets the url property, unregisters any uncalled listener, and registers a listener for error that unregisters itself.
  • onRender calls setUrl
  • onDestroy we unregister any listener that has not been called.
  • If the image does not load, we set the src to the user provided image.
  • Tests added for the above functionality.

Tests pass in FF 3 and Safari 3. Will check IE after lunch. Thanks for any review.

06/12/09 21:43:42 changed by ahocevar

  • state changed from Review to Commit.

Patch looks good, tests are plausible. Tested in IE7 and tests pass. Please commit.

06/12/09 23:32:03 changed by tschaub

  • status changed from new to closed.
  • state changed from Commit to None.
  • resolution set to fixed.

Fixed in r1067.