I needed class who I can put on some link to exclude Ajax normal behaviors. Because my drupal webSite is entire ajax.

So i did that :

In ajax _pages.module :

In line 130 
+++
  $form['ajax_pages_links_excluder'] = array(
    '#type' => 'textfield',
    '#title' => t('Ajax links exclusion'),
    '#default_value' => variable_get('ajax_pages_links_excluder', NULL),
    '#size' => 60,
    '#description' => t('A jQuery selector that specifies all of the links that you DONT want to enable Ajax page loads for.<br />Example: .ajaxOff'),
    '#required' => FALSE,
  ); //   /!\ Suround ".ajaxOff" with < code > balise
In line 73 
+++
      'linksExcluder' => variable_get('ajax_pages_links_excluder', NULL),

In ajax _pages.js :

In line 48
---      $(document).delegate(settings.ajaxPages.linksSelector, 'click', function(e) {
+++      $(document).delegate(settings.ajaxPages.linksSelector + ":not('" + settings.ajaxPages.linksExcluder + "')", 'click', function(e) {

Let me know if I'm doing it wrong. I have no illusions about it, I'm pretty sure it's the bad way to do it but it work and it a good new feature.

Comments

bumpshoveit’s picture

Issue summary: View changes
jamix’s picture

If the link you want to exclude has a particular CSS class (e.g. ajax-pages-exclude), you can simply update your Ajax links selector in the module options as follows:

#page-wrapper a:not(.ajax-pages-exclude)

This will tell Ajax pages not to attach itself to the links of class ajax-pages-exclude.

There's more on what you can do with the selectors in jQuery documentation.

T.Mardi’s picture

Hi jamix, can this be used to exclude forms too? Coming from the related issue about disabling ajax on forms.

jamix’s picture

No, I'm afraid not. Excluding forms requires some kind of a different approach implemented.