Facets configured to use the 'links with checkboxes' display only implement ajax on the link. Clicking the checkbox causes the page to refresh

I can see code relating to this in a patch submitted for another issue http://drupal.org/node/1341704#comment-6173074. It doesn't look like this made it to the dev version. I've implemented a fix locally and can submit a patch if it's not already being worked on.

CommentFileSizeAuthor
#10 search_api_ajax-checkbox_support-1834652-9.patch419 bytespix_
#2 1834652-2.patch860 bytesAnonymous (not verified)
#1 1834652-1.patch1.36 KBAnonymous (not verified)

Comments

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new1.36 KB

Can you review this patch is working?

Anonymous’s picture

StatusFileSize
new860 bytes

Right patch attached.

Anonymous’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

multpix’s picture

hi!

latest dev

after clicking on the checkbox, i see #path= in string URL (half a second)
but then still occurs reload page
and without # in URL

multpix’s picture

Status: Closed (fixed) » Active

this behavior is different from clicking on the link
how to fix?

many thanks ))

makangus’s picture

Same problem as @multpix here.

Anonymous’s picture

What happens is that Facetapi has its own jQuery trigger already active, and we try to disable it by (see patch #2):

 $(selector + ' .facetapi-checkbox').unbind('click');

Apparently this unbind does not work? So it triggers both actions, therefore reloads the page. We just need to find out how to correctly unbind the facetapi jquery action.

gigabates’s picture

As far as I can see the syntax of unbind method is correct, but it's being called before facet_api has added its click handler and there is nothing to unbind yet. To correct this we would need to adjust the weight when attaching the JavaScript file so its attach method is called after facet_api's.

pix_’s picture

Issue summary: View changes
StatusFileSize
new419 bytes

Here a patch for the unbinding issue. I've added the Drupal.search_api_ajax.ajax in a behaviour so it's fired not only once, at the page load.

Anonymous’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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