Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out why certain file types do not work with img tag on hover event #122

Closed
puzzledShark opened this issue Mar 20, 2015 · 3 comments
Closed

Comments

@puzzledShark
Copy link

Presently with the <img> tag in relation to hovering over the src, there are certain file types that don't presently appear to work, these being:

bmp
no file type(extension)
tiff(but it doesn't appear to be a web file format, so neglect able I imagine)

The following are presently working:

svg
jpg
jpeg
png
gif

@humphd
Copy link

humphd commented Mar 20, 2015

There's a possible way to hack this upstream to make it work for any URL. It involves programmatically trying to assign a URL to an img element's src, and listening for onload and onerror:

var img = document.createElement('img');
img.onload = function() {
  // url points to an image and can be loaded, display pop-up
};
img.onerror = function() {
  // url points to a non-image, and can't be loaded, don't display.
};
img.src = url;

I'd look in Brackets' upstream issues and see if this is filed already.

@humphd humphd added this to the PPP.1 milestone Mar 23, 2015
@humphd humphd self-assigned this Mar 23, 2015
@humphd
Copy link

humphd commented Mar 23, 2015

I filed adobe#10786 upstream.

@gideonthomas gideonthomas removed this from the PPP.1 milestone Apr 2, 2015
@gideonthomas gideonthomas added this to the Heartbeat 1 milestone May 11, 2015
@humphd
Copy link

humphd commented May 15, 2015

I got sick of waiting for this to land upstream, so I've just landed it on our fork. Closing.

@humphd humphd closed this as completed May 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants