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

Change to use andSelf to ensure backward compatibility with jquery < 1.9 #3

Closed
wants to merge 2 commits into from

Conversation

kabudu
Copy link

@kabudu kabudu commented May 6, 2013

For those using jquery < 1.9 such as symfony 2 installs using the mopa bootstrap bundle, the function addBack does not exist rendering the plugin un-useable. I've made a change to use the function andSelf which makes the plugin backward compatible and forward compatible as andSelf is an alias to addBack in jquery >= 1.9.

@digggggggggg
Copy link
Contributor

andSelf has been depricated and will be eventually dropped. It is more important to ensure the plugin's compatibility with future versions of jQuery than with past versions (specially beyond 1.8).

If anything we'll need line 239 to be...

this.prevAll()[$.fn.addBack?'addBack':'andSelf']().filter('.rater-'+ control.serial).addClass('star-rating-hover');

...although I am in favour of pushing everyone up to jQuery 1.9. This isn't the only plugin that has been adapted, I feel this is what's best for the community.

What are the chances of symfony being updated any time soon?

Perhaps you could fork the plugin and use the patch I suggested above (so this doesn't have to go in the main dev branch)?

@kabudu
Copy link
Author

kabudu commented May 8, 2013

Your argument makes a lot of sense, however I'm unsure when the mopa bootstrap bundle will have its jquery version updated, so in order to use your library now I believe your solution is better than mine. I've already forked your plugin and using it with the changes I made, but I'll update my change to use yours instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants