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

IE8 fallback PNG support #76

Closed
seyfro opened this issue Jan 23, 2015 · 7 comments
Closed

IE8 fallback PNG support #76

seyfro opened this issue Jan 23, 2015 · 7 comments

Comments

@seyfro
Copy link

seyfro commented Jan 23, 2015

Hi Robert,

first thanks a lot for the new release - will update my plugin with the next release. As backward compatibility for IE8 is an issue for me, I have searched and found a workaround, so that when the minimap is viewed with IE8, at least the PNG icon and not an empty control is displayed.

old
´´´.leaflet-control-minimap-toggle-display{
background-image: url("images/toggle.svg");
background-size: cover;
position: absolute;
border-radius: 3px 0px 0px 0px;
}´´´

new
´´´.leaflet-control-minimap-toggle-display{
background-image: url("images/toggle.svg");
background-image:url(images/toggle.png)\0; /workaround for IE8/
background-size: cover;
position: absolute;
border-radius: 3px 0px 0px 0px;
}´´´

background infos:
http://dimox.net/personal-css-hacks-for-ie6-ie7-ie8/
https://stackoverflow.com/questions/5852681/target-ie9-or-ie8-but-not-both-using-css
https://stackoverflow.com/questions/660652/ie8-css-selector

let me know if that would work for you too!
best,

Robert

@robpvn
Copy link
Contributor

robpvn commented Jan 26, 2015

I don't like those hacks, but upon thinking a bit more about it I realise that Leaflet has the leaflet-oldie CSS class for this kind of thing, so it should work if we implement that. (A CSS selector named .leaflet-oldie .leaflet-control-minimap-toggle-display That would mean making Leaflet 0.7.0 our minimum required version, which shouldn't be so bad considering it's over a year old and rock stable. (And we'd bump our version to 3.0, hurray!)

But I don't have any IE8 to test with, can you help in that department?

@robpvn
Copy link
Contributor

robpvn commented Jan 27, 2015

I created a branch for new IE8 support, but it needs some testing. I think it should work fine, and the CSS works correctly when I alter it in Firebug, but someone needs to test it against a real IE8 to make sure it works.

@seyfro
Copy link
Author

seyfro commented Jan 27, 2015

using leaflet-oldie is better than that dirty hack, good point. Just tested it successfully with IE8. BTW: with IE9 the svg image is used, but the rotation when clicking on it does not work.

@robpvn
Copy link
Contributor

robpvn commented Jan 30, 2015

I added the space like you suggested in the commit comment, is it all good now?

@seyfro
Copy link
Author

seyfro commented Jan 30, 2015

yes, with spaces PNG is shown in IE8

@robpvn
Copy link
Contributor

robpvn commented Feb 4, 2015

OK, with the new release 2.1.0 we should have the best of both worlds, SVG for modern browsers and PNG for crotchety old fossils like IE8!

@robpvn robpvn closed this as completed Feb 4, 2015
@seyfro
Copy link
Author

seyfro commented Feb 4, 2015

great, thanks!

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

2 participants