In theme/flag.js for flagClick(), at the very end of the function, you are calling return false regardless of the state of the click. This is a bad JS pattern, as it prevents the click event from bubbling up to any handlers waiting on the click above it. Instead, preventDefault() should be used instead to prevent the default click handler for the browser, but still allow clicks to come through.

Attached is a patch that should fix everything up.

CommentFileSizeAuthor
flag_js_eventhandler.patch794 bytestimdorr

Comments

joachim’s picture

Version: 7.x-2.0-beta6 » 7.x-3.x-dev
Status: Active » Needs review

Needs review from someone who knows more JS than me!

nod_’s picture

For some reason I'm following this issue.

Code is ok. RTBC if it still applies.

joachim’s picture

flag_js_eventhandler.patch queued for re-testing.

socketwench’s picture

Issue tags: +Needs manual testing

Wouldn't this need manual testing? (I'm still trying to figure out the testing framework.)

joachim’s picture

Yes, would need manual testing, as Simpletest doesn't do any JS.

(Are you still getting tons of PHP 5.4 errors?)

joachim’s picture

Status: Needs review » Fixed

Tested patch and links work fine with it.

Committed with a whitespace fix.

git commit -m "Issue #1373550 by timdorr: Fixed Javascript on flag links preventing event bubbling." --author="git "

socketwench’s picture

Actually, I don't know if I'm still getting the 5.4 errors. I downgraded my system since then and never bothered to move it forward.

Automatically closed -- issue fixed for 2 weeks with no activity.