RobinBrouwer/gritter

Notification content displayed before background

3en opened this issue · 6 comments

3en commented

Hi,

http://www.youtube.com/watch?v=DJ6L_D4FaWw

Then content of the notification seems to get displayed before the background is loaded. Is there a way to fix this perhaps loading the notifications only once the page has loaded/rendered?

3en commented

I just noticed Gritter is using a PNG image for the background box with rounded corners. Having this rendered in CSS3 would certainly reduce the load times for the background.

You're absolutely right. It's something I wanted to add for some time, but didn't really have the time to do it. Problem with using CSS3 however is that the rounded corners won't show in IE7&8. PIE.htc could fix this, but I don't think it's a good idea to add PIE to gritter by default. I guess that's why PNG's are used: compatibility. Although, it won't work in IE6, but who cares? :P

What do you think? Use CSS3 and don't be compatible with IE7&8 or leave it as is? I guess it's also possible to use the PNG's when IE7/8 is used and CSS3 for the other browsers. However, the gritter jQuery plugin itself is not mine and I don't know if I'm really allowed to change things. I should check that out.

I recently bought myself a house, so in the coming weeks I don't have much time to fix it myself. If you want to fix it, you're welcome to do so. Just create a pull request and I'll merge it. :)

3en commented

Yeah probably not the best thing to introduce bloat/dependencies with bringing in more libraries.

CSS3 for other browsers and falling back on the PNG for IE7/8 sounds like the best idea. Perhaps even an option to turn on/off image or CSS3. I think I might be able to come up with a CSS hack using conditional statements in CSS but that doesn't seem clean to me but avoids the issues of having to hack around the original plugin.

Good point that this will probably need patching back to the original jQuery plugin: https://github.com/jboesch/Gritter

Goodluck with the house move Robin, congrats on the buy! Unfortunate i'm a little busy too with deadlines but if I get some free time I'll see what I can do.

Thanks. :) I guess creating an issue for the jQuery plugin is a good idea. I also see there are some new features I haven't added to the Rails gem, like positioning the notifications to different corners. When CSS3 support is added to the gritter jQuery plugin, I'll fetch the newest version and add all the new options to the gem.

I added CSS3 support for gritter version 1.0.0. It's in the edge branch and will be pushed to RubyGems tomorrow. I have to test it some more first.

3en commented

Nice one Robin! Thanks