HotInk / hotink

Web-publishing application for Canadian University Press
http://hotink.net
MIT License
18 stars 3 forks source link

Clicking "edit" on newly-attached media causes Fancybox to fail to open #31

Closed ghost closed 14 years ago

ghost commented 14 years ago

After uploading an image from an article page, and clicking the "edit" button before reloading the page, this screen showed up:

When I hit save, the JS response was interpreted as text (which makes sense as the plain HTML page had no JS event handler attached to it):

This only happens when the page hasn't been reloaded—I'm guessing there's some event handler that isn't getting attached after the image upload form submits. I'm working on the HEAD version—is this happening in production or is this a recent issue?

chrisdinn commented 14 years ago

I've heard reports of people encountering this in production. I'd consider this a priority.

I'm not 100% sure what's going on right now, but this bug report is a big help. It's probably just a matter of changing a 'click' handler to a live('click'), so that the handler becomes active on elements added to the DOM after the handler is loaded.

ghost commented 14 years ago

Ugly fix for issue where clicking edit on a newly-attached media file didn't bring up the fancybox. Closed by e4f714c13748dcc8d898767743e4500f38eaebd5.