Hi,
Bricolage 2.x uses Prototype 1.6.0.3 and in various bits of Bricolage's
JavaScript, it uses getElementsByClassName(). The problem is that newer
browsers have a native implementation of it which is different to what
Prototype implements, causing slight differences in what it returns. See:
http://www.prototypejs.org/api/element/getElementsByClassName
For example, we have this snippet of code in comp/media/js/lib.js,
FastAdd.add():
document.getElementsByClassName('value', this.list)
which I believe is supposed to return an array of elements in this.list
that have the 'value' class. Because Prototype doesn't declare its
version of the function on modern browsers that already have that
function, it returns all elements in the _whole document_ with the value
class.
I'd create a patch for this, but I'm not 100% on Bricolage's UI to test
the changes. There aren't too many uses of getElementsByClassName(),
but I believe things like:
lbActions = document.getElementsByClassName('lbAction');
should get changed to:
lbActions = $$('.lbAction');
and:
document.getElementsByClassName('value', this.list)
to:
this.list.select('.value')
Adrian
Bricolage 2.x uses Prototype 1.6.0.3 and in various bits of Bricolage's
JavaScript, it uses getElementsByClassName(). The problem is that newer
browsers have a native implementation of it which is different to what
Prototype implements, causing slight differences in what it returns. See:
http://www.prototypejs.org/api/element/getElementsByClassName
For example, we have this snippet of code in comp/media/js/lib.js,
FastAdd.add():
document.getElementsByClassName('value', this.list)
which I believe is supposed to return an array of elements in this.list
that have the 'value' class. Because Prototype doesn't declare its
version of the function on modern browsers that already have that
function, it returns all elements in the _whole document_ with the value
class.
I'd create a patch for this, but I'm not 100% on Bricolage's UI to test
the changes. There aren't too many uses of getElementsByClassName(),
but I believe things like:
lbActions = document.getElementsByClassName('lbAction');
should get changed to:
lbActions = $$('.lbAction');
and:
document.getElementsByClassName('value', this.list)
to:
this.list.select('.value')
Adrian