Hi,

When i click the previous or next button nothing happens on the front end.
No errors either.

On the backend it works..

anyone?

Comments

fietserwin’s picture

Start by comparing the settings.

harings_rob’s picture

StatusFileSize
new40.07 KB

What settings?

In the attachment are my current ones:

fietserwin’s picture

OK, your settings seem fine. I guess that there is some javascript error on your page that prevents the code that reacts to button clicks from being run.

Check with firebug that you don't have any javascript error on your page.

fietserwin’s picture

Status: Active » Closed (works as designed)

Did I guess correctly? If not, please feel free to reopen this issue.

harings_rob’s picture

Status: Closed (works as designed) » Needs work

Hi,

I checked on everything disabled every js file and still not works.

Reopend

fietserwin’s picture

Status: Needs work » Postponed (maintainer needs more info)

Do not disable js files, but check with firebug (being active before loading the page!) that you don't see any errors on the console tab. If no js error gets listed, you will have to debug the js code. Set breakpoints at the 1st, 2nd and 3rd line of function initHandlers() in availability_calendar.viewport.js to see if these lines get reached at all.

Let me know your findings.

harings_rob’s picture

Hi,

There are no errors when viewing in firebug.

I'll try the breaks tonight

kevinquillen’s picture

I have this same issue when using the twitter Bootstrap theme. The javascript is firing and I can see the DOM adjusting the element positions of the viewport, but the month itself is not sliding to the next or previous month. No js errors in the console. The events are firing.

fietserwin’s picture

Status: Postponed (maintainer needs more info) » Active

For me it works fine with jQuery 1.8 in both Bartikand Seven.

Does the Bootstrap theme set the dir attribute? (see e.g. issue #1732772: Add html tag to html.tpl.php)

If so, can you check the dimensions calculations?
- Starting at line 91 of availability_calendar.viewport.js (that is within function initSettings())
- continuing in function calculateDimensions() at line 103 of that file

do you see any strange things, e.g. the jquery.actual plugin returning 0 at some point?

Note: does it occur both in viewing and editing?

kevinquillen’s picture

I see the issue, I will attach a patch.

kevinquillen’s picture

edit: scratch this, wrong patch attached

kevinquillen’s picture

Here is the correct patch.

This will default to isLtr true if the html tag has no dir attribute defined, otherwise it will evaluate the dir value.

var isLtr = (typeof $('html').attr('dir') === 'undefined') ? true : ($('html').attr('dir') === 'ltr');

I tested this without a dir tag, and with a dir tag, with the dir tag as ltr, rtl and got the expected behavior.

This really threw me because (I am not so familiar with Bootstrap) but it was hard to track down.

fietserwin’s picture

Status: Active » Reviewed & tested by the community

Thanks. I think it is better to follow your suggestion, even though I do consider this an error in bootstrap. But I guess that most sites are LTR and that it should be seen as default if the attribute is missing.

Drupal themes really should set the dir attribute as Drupal supports sites in 1 language that differs from English and multilingual sites with both LTR and RTL languages. So good behaving contrib modules and themes should cater for that as well. So, I suggest you also post an issue in the Bootstrap theme issue queue!

I will fix and commit it later today. I will then also set it to fixed again. OP: please feel free to reopen if this still does not solve your problem. But as you can see, I do need more info from you in that case: theme, jquery version, what do the (above mentioned) calculations result in, etc.

kevinquillen’s picture

I do as well (Bootstrap issue)- none of the usual Drupal attributes are on the HTML tag at all. Thats a first for me to see in many years, was hard to see that at first.

fietserwin’s picture

Version: 7.x-4.0 » 7.x-4.x-dev
Status: Reviewed & tested by the community » Fixed

Fixed and committed.

The actual change is even simpler:

      var isLtr = $('html').attr('dir') !== 'rtl';

The jQuery docs state that

As of jQuery 1.6, the .attr() method returns undefined ...

So I guess that before 1.6 it returned the empty string or something like that and because 1.5 is still the "official" version for Drupal, I decided to test like I do above.

kevinquillen’s picture

Good reduction!

Status: Fixed » Closed (fixed)

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