Wrong case for use jquery compability mode
igor.ro - August 11, 2009 - 12:52
| Project: | jQuery Compatibility Mode |
| Version: | 6.x-1.5 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | by design |
Jump to:
Description
We have case for use mode like
if (after('Drupal.', $contents, FALSE) && (after('$(', $contents)) && !after('(function($)', $contents, FALSE) && !after('var run_through_jquery_compatibility_mode = FALSE;', $contents, FALSE)) {
return TRUE;
}It means that file must contatins Drupal. and $(.
Suggest to use
if ((after('Drupal.', $contents, FALSE) || after('$(', $contents)) && !after('(function($)', $contents, FALSE) && !after('var run_through_jquery_compatibility_mode = FALSE;', $contents, FALSE)) {
return TRUE;
}Here is a patch.
Thanks.
| Attachment | Size |
|---|---|
| jquery_compatibility.patch | 944 bytes |

#1
#2
The reason it requires drupal and $( is because not all files that have $( are drupal jquery files. And since this module is meant only for those that have to deal with drupal, I have required the word drupal to be in it. I couldnt think of any situation where the two would never both be present. What is your use case where only $( was available?