since i was the one who suggested the current approach, and it's wrong, i figured it was my resposibility to provide the fix... ;)

basically, Drupal.jsEnabled should be called before _any_ javascript is run. $() creates a jquery object, so that has to go inside a jsEnabled check. and according to steven:

UnConeD: hunmonk: the only exception is function definitions actually
UnConeD: hunmonk: because they don't actually run code
UnConeD: so Drupal.foobar = function () { .. } is allowed outside

patch also applies cleanly to HEAD. i didn't test it on an install, so you might want to do a quick test before committing.

CommentFileSizeAuthor
signup_js_killswitch.patch503 byteshunmonk

Comments

dww’s picture

Status: Needs review » Reviewed & tested by the community

cool, thanks. tested and everything still seems to work fine.

hunmonk’s picture

Status: Reviewed & tested by the community » Fixed

committed to 5 and HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)