HI,

Problem

after i updated Opera to Version 11.62 i found my site scrwed up in every way. About all jQuery scripts seems to be broken and i broke down the problem to Language Dropwdown.

If i disable Language Dropdown, all works just fine.
Opera gives me the following error:

Uncaught exception: Error: set to what?

Solution:

The MSDropwDown the TehFAIL

In lang_dropdown.js change:
Drupal.behaviors.langDropdown = function(context) {
$('#edit-lang-dropdown-select').change(function() {
window.location.href = this.options[this.selectedIndex].value;
});

if (Drupal.settings.langDropdown) {
var flags = Drupal.settings.langDropdown.jsWidget.languageicons;
if (flags) {
$.each(flags, function(index, value) {
$('#edit-lang-dropdown-select option[value=' + index + ']').attr('title', value);
});
}

var msddSettings = Drupal.settings.langDropdown.jsWidget;
try{
$('#edit-lang-dropdown-select').msDropDown({
visibleRows: msddSettings.visibleRows,
rowHeight: msddSettings.rowHeight,
animStyle: msddSettings.animStyle
});}
catch(e)
{
// ownage
}

$('form#lang-dropdown-form').after('

');

}
}

If you see, i just added an error handler (try catch block). This dont fix the MSDropDown but it wont break other scripts anymore !

Thanks and Greetings !

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

manfer’s picture

It is a good idea to add that error handling to the code.

Anyway I don't know why that version of opera stops executing the rest of the code. I think browsers continue executing code no matter if there are not caught exceptions. Besides that exception does not breaks the dropdown functionality.

Drupality’s picture

Since i posted this issue also on the MSDropDown Page, there is a new Version available.
https://github.com/marghoobsuleman/ms-Dropdown/blob/master/msdropdown/js...

You cannot include it directly like this, ther eis some work needed to implement this new version into language drop-down.

I'm looking forward to it !

manfer’s picture

In previous versions 37.5 of that library it had a problem on the computation of when it should be opened upwards and when not. In the version included in the 7.x version of this drupal module I was making changes to the library to correct that problem.

It seems that the library have been changed again, version 38 and 38.1 and now the problem not only happens on the computation when it must open upwards but it incorrectly positions the options when it opens them downwards (this is not always, and that's why it does not appear in the library examples, but when the select is inside div layers the problem will appear in most cases).

So I can upgrade to that version and tweak it again and maybe fork in github requesting a pull.

Anyway I don't think upgrading the library makes it less good idea to include the error handling code. As msDropDown function can throw a exception it is better to include the try/catch code.

manfer’s picture

manfer’s picture

I'm pushing this patch that solves the lack of error handling issue. I will open a new issue to handle the library upgrade.

manfer’s picture

Version: 6.x-1.6 » 7.x-1.x-dev
FileSize
876 bytes

Version 7.x of the module needs to be patched too.

manfer’s picture

Status: Active » Fixed

Pushed.

josebc’s picture

+1

Status: Fixed » Closed (fixed)

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

knalstaaf’s picture

Title: Language Dropdown breaks other jQuery based Javascripts in Opera 11.62 WITH SOLUTION ! » Language Dropdown breaks combined with other jQuery based Javascripts
Version: 7.x-1.x-dev » 7.x-1.5
Status: Closed (fixed) » Active
FileSize
18.33 KB

I'm using it in the latest version of Firefox (currently 13.0.1) and unfortunately it still looks for trouble with other jQuery driven applications.

In my case the language switcher dropdown sits in the same region a Views Slideshow.

When the LSD is located on top of the slideshow in the block administration (admin/structure/block/list/seven), the dropdown itself breaks, it only shows links, no animation nor markup. The slideshow keeps working.

When positioning them the other way around: all works fine.

So in fact it looks like the LSD became the target of other jQuery applications.

I tested this in Firefox 13.0.1 with LSD v 7.x-1.5 (latest) and Views and Views 7.x-3.3 (latest) Slideshow 7.x-3.0 (latest) with the default Seven theme of D7.

knalstaaf’s picture

Status: Active » Fixed

I see it works with the dev-version. It still has to be committed to the recommended releases I guess.

knalstaaf’s picture

Status: Fixed » Needs review

I'm reopening this because I still have some issues using the minimal version of the cycle.js script (required for Views Slideshow). Wen using the full version of cycle.js for the slideshow all is ok.

manfer’s picture

Title: Language Dropdown breaks combined with other jQuery based Javascripts » Language Dropdown breaks other jQuery based Javascripts in Opera 11.62 WITH SOLUTION !
Status: Needs review » Fixed

You have reopened an issue that has nothing to do with your problem and that is already fixed and with the patch pushed.

Please always open your own issue when you find a problem unless it is an active issue and you are sure you are facing same problem.

Besides take in mind that needs review status is used when there is a patch that must be reviewed by the community while there is not patch yet the correct status is active.

I have not tested if there is some kind of collision between cycle.js and jquery.dd.js minimized versions. Open other issue, copy your text from here if you want and it would be helpful to have a link to a site with the problem.

manfer’s picture

Priority: Critical » Minor
Status: Fixed » Active
FileSize
1.5 KB

The path for version 7 in #6 part of the solution of this issue with opera was not correct. Really all works fine anyway as the real solution was the upgrade of the javascript library used by the dropdown. Anyway new patch.

manfer’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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