I have a view which is setup to use ajax, and I'm using beauty tips as outlined here:
http://wootenswebdesign.com/quick-and-easy-beauty-tips

Now, it works GREAT, thanks, but if I have a view, which uses ajax, when I click the next page in the pager, beauty tips 'turns off'. Upon viewing the source, it looks like everything for beauty tips is there, but all of the stuff which should appear in BT shows as html inside the browser 'tool-tip'.

I added a echo rand function to the php header for the view, and it looks like it gets re-read every time that the view is refreshed via ajax, but alas, as I said BT stops working.

I'm guessing that this is likely a views issue, but thought I might could start here.

Comments

Macronomicus’s picture

Same issue and im not using it as outlined in http://wootenswebdesign.com/quick-and-easy-beauty-tips Im doing it the traditional way through a module & from my template.php. As soon as you click an ajax pager it kills beautytips. Weird thing is I have several methods going on. In my blocks Im using a preprocess_block function from my sites theme template.php; using that pager breaks any beautytip on the page. For my calendar views im using a custom module that calls the beautytips with an implementation of hook_init()

Other AJAX stuff is still working though, so its pager related .. I have an ajax taxonomy filter and I can use that and it doesn't break my calendar views but it does break beautytips in the block views. I suppose its easy enough to turn off ajax pagers but this seems to be a bug somewhere in the mix.

Im using Views 3.x

Awesome module by the way I totally love it!!
Cheers!

Macronomicus’s picture

well .. I was wrong ... the bug is moving around on me.. my most recent test when I clicked the ajax pager in the block beautytips worked on the block but broke it in the calendar view above... so its not exactly like I said above.

jody lynn’s picture

Title: ajax views and beauty tips » Beautytips break on attachBehaviors
Status: Active » Needs work
StatusFileSize
new6.46 KB

I have the same bug. In my case, if you upload a file with filefield (which is an ahah form) all the beautytips on the page no longer work.

When I inspected with Firebug what was happening when I clicked on a beautytip, it looked like possibly it was responding as thought it were being clicked twice (I could see a flash in the markup of the active class appearing and disappearing). I think that the problem is that when attachBehaviors is ran following an AJAX maneuver that the beautytips behavior is re-applied to existing elements.

This patch is a band-aid that ensures the behavior is only run once (but prevents any necessary re-attachment). What really needs to happen is some implementation of the -processed class addition that most behaviors use.

kleinmp’s picture

Status: Needs work » Needs review

I added some processed checks into the 6.x-2.x-dev version of the module. It was working for me, but if someone could verify that it works for them, then we can close this issue.

tim.plunkett’s picture

Status: Needs review » Fixed

This patch is no longer necessary, the processed checking in the latest dev works great.

Status: Fixed » Closed (fixed)

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

bobslee’s picture

StatusFileSize
new391 bytes

This works for me in Drupal 7... Check this issue
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');