getElementsByClass by class - old version?

subspaceeddy - September 23, 2007 - 17:22
Project:curvyCorners
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:JStarcher
Status:closed
Description

Hi,

The version of getElementsByClass used in this module is not the current one on http://www.dustindiaz.com/getelementsbyclass/. The version you have will not style content like this:
<div class="mybox curvy">
where 'curvy' is the class passed in new curvyCorners(settings, "curvy"); - it will only style 'curvy' for single class definitions on a div (i.e. <div class="curvy">

The offending line is:var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)");
The fix is:var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
Note the double back-slash before the 's'. This change is not documented on the main site, but i read about it somewhere else (can't remember where) when I was trying to find a fix for this problem.

Having a multiple class definition will increase flexibility since we can just add 'curvy' or whatever to the divs we wish to make curvy, and have the main style definition for the div in a more appropriate class definition.

#1

JStarcher - September 23, 2007 - 18:43

Isn't this more of a curvyCorners issue rather then an issue with my module? This module simply implements curvyCorners into Drupal and nothing more.

#2

subspaceeddy - September 23, 2007 - 23:09

Oh yeah, sorry :) wasn't thinking straight.

#3

JStarcher - September 24, 2007 - 00:12
Assigned to:Anonymous» JStarcher
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.