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

fix for disabling non-remote links #362

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pekeler
Copy link
Contributor

@pekeler pekeler commented Mar 3, 2014

Fixes #306, probably also fixes #355.

Non-remote links' default handler is now slightly delayed so that browsers repaint the link with their new disable text/status (this is an issue in Safari and Chrome). This change also fixes an issue in IE where a link with a disable-with attribute around a div doesn't perform the default event handler. As a side effect of this change, calling .trigger('click') on a link will now actually change the window's location - changed a fixture and a test to deal with this.
#361 demonstrates the two problems which are fixed by this change.

If you don't like the changes to the tests, we could alternatively overwrite $.rails.followLink to not do anything during the unit tests.

I ran the unit tests with random jQuery versions (mostly 1.11.0, though) successfully (except for #359) in:
Safari 7, OSX 10.9
Firefox 27, OSX 10.9
Chrome 33, OSX 10.9
IE11, Win8.1 (emulated)
IE10, Win8 (emulated)
IE9, Win7 (emulated)
IE8, Win7 (emulated)
IE7, Vista (emulated)

I tested my Rails app with this change and jQuery 1.11.0 successfully in
Mobile Safari 7, iOS 7
Android Browser 4.3 (emulated)
Android Browser 4.0.3 (emulated)
Safari 7, OSX 10.9
Firefox 27, OSX 10.9
Chrome 33, OSX 10.9
IE11, Win8.1 (emulated)
IE10, Win8 (emulated)
IE9, Win7 (emulated)
IE8, Win7 (emulated)
IE7, Vista (emulated)

…wsers repaint the link with their new disable text/status (this is an issue in Safari and Chrome). This change also fixes an issue in IE where a link with a disable-with attribute around a div doesn't perform the default event handler. As a side effect of this change, calling .trigger('click') on a link will now actually change the window's location - changed a fixture and a test to deal with this.
@pekeler
Copy link
Contributor Author

pekeler commented Mar 3, 2014

Quickly try this change in your app by pointing jquery-rails to 'https://github.com/pekeler/jquery-rails.git' in your Gemfile.

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.

Disable with not working on IE11 (W8.1) disable_with doesn't work with link in Safari
1 participant