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 !
Comment | File | Size | Author |
---|---|---|---|
#14 | language_switcher_dropdown-error_handling-1508030-14.patch | 1.5 KB | manfer |
#10 | LSD breaks | 18.33 KB | knalstaaf |
#6 | language_switcher_dropdown-error_handling-1508030-6.patch | 876 bytes | manfer |
#4 | language_switcher_dropdown-error_handling-1508030-4.patch | 814 bytes | manfer |
Comments
Comment #1
manfer CreditAttribution: manfer commentedIt 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.Comment #2
Drupality CreditAttribution: Drupality commentedSince 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 !
Comment #3
manfer CreditAttribution: manfer commentedIn 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.
Comment #4
manfer CreditAttribution: manfer commentedComment #5
manfer CreditAttribution: manfer commentedI'm pushing this patch that solves the lack of error handling issue. I will open a new issue to handle the library upgrade.
Comment #6
manfer CreditAttribution: manfer commentedVersion 7.x of the module needs to be patched too.
Comment #7
manfer CreditAttribution: manfer commentedPushed.
Comment #8
josebc CreditAttribution: josebc commented+1
Comment #10
knalstaaf CreditAttribution: knalstaaf commentedI'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.
Comment #11
knalstaaf CreditAttribution: knalstaaf commentedI see it works with the dev-version. It still has to be committed to the recommended releases I guess.
Comment #12
knalstaaf CreditAttribution: knalstaaf commentedI'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.
Comment #13
manfer CreditAttribution: manfer commentedYou 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.
Comment #14
manfer CreditAttribution: manfer commentedThe 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.
Comment #15
manfer CreditAttribution: manfer commented