Code required by plugin causes clash with FCKEditor

wonder95 - April 7, 2009 - 23:16
Project:jCarousel
Version:5.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I was having an issue with FCKEditor, and I traced it to jCarousel. It was caused by the following code that is required by the plugin:

<script type="text/javascript">
$(document).ready(function() {
  $('#mycarousel').jcarousel();
});
</script>

I had it in my page.tpl.php, and since jcarousel.js is only loaded on node pages, this call when it wasn't loaded caused an error, which caused problems with FCKEditor. I moved the code to jcarousel.js, and everything works fine now. However, there are probably better ways to do it such as adding it to the modele in jcarousel_nodeapi() with drupal_add_js(). I do know the call to $('#mycarousel').jcarousel() is required, because nothing works without it. If you think the addition to hook_nodeapi() is the way to go, I'm willing to roll a patch for it.

#1

Wim Leers - April 8, 2009 - 05:45
Status:active» postponed (maintainer needs more info)

I'm clueless as to how this could cause conflicts with any other JS… So please explain how this causes problems!

#2

wonder95 - April 11, 2009 - 16:50

Me, too. All I know is when the code I referenced above is loaded in a page where the jcarousel.js has not been loaded, I get the issues with the smaller text field and missing editor (see my issue I referenced in the original post). I don't have the time to look at it right now, but I'll dig into it when I get a chance.

#3

Wim Leers - November 3, 2009 - 17:19
Status:postponed (maintainer needs more info)» closed

Closing due to lack of response.

 
 

Drupal is a registered trademark of Dries Buytaert.