Hi,

I want to use Colorbox which shows me additional content using BeautyTips. This does not work as BeautyTips seems to be processed only once loading the page. Any ideas how to get the BeautyTips on content which is loaded into the page later on?

CommentFileSizeAuthor
#3 beautytips-1535320.patch12.08 KBbobslee
#2 beautytips-738100.patch391 bytesbobslee

Comments

Wolfgang Reszel’s picture

Sorry, I don't know what I've done, but now it's working. ;-)

bobslee’s picture

StatusFileSize
new391 bytes

Following I added also (duplicate) on drupal 6 issue

This works for me in Drupal 7...
Attached patch ensures the Drupal behaviors are registered for the BeautyTip.
Before using this version, be sure that you minify this to beautytips.min.js (e.g. via jscompress.com).

Be sure the behaviour's Javscript(file) is loaded, otherwise it won't work.
For example for the autocomplete JS:

In hook preprocess_page: drupal_add_js('/misc/autocomplete.js');

bobslee’s picture

StatusFileSize
new12.08 KB

Attached is a cumulative patch on files: beautytips.js, beautytips.min.js.
I stumbled on a related (2nd) problem.

With the previous patch:
After the page is loaded, then the behviours in the 1st shown BeautyTip (BT) work properly.
However when you close the 1st BT, then in the next shown BT's, the behviors aren't attached anymore.

The Attached patch deals with this.
It's a workaround.. so don't expect reliability!
The patch disables the ajaxCache (option).
Also, this patch is cumulative and contains the former patch as well.

Problem explanation:
The option ajaxCache is enabled by default.
So data won't be loaded again from the given Ajax path.
In this case:
- When BT gets hidden by btOff(), then BT DOM-object is stored in cache and removed.
- When BT gets shown, the DOM-object is added from the cache by btOn().
Then some Drupal behaviors, like autocomplete, won't get attached.

Maybe this could be an issue in (some) Drupal JS/behaviors modules, like autocomplete?
Or is it just how the DOM works?

bobslee’s picture

Status: Active » Needs review
pifagor’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)