Changeset 8431
- Timestamp:
- 05/06/07 16:35:47 (19 months ago)
- Files:
-
- 1 modified
-
dojo/trunk/_base/html.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/_base/html.js
r8426 r8431 512 512 513 513 dojo.hasClass = function(/*HTMLElement*/node, /*String*/classStr){ 514 // summary 515 // Returns whether or not the specified classes are a portion of the516 // class list currently applied to the node.514 // summary: 515 // Returns whether or not the specified classes are a portion of the 516 // class list currently applied to the node. 517 517 return (new RegExp('(^|\\s+)'+classStr+'(\\s+|$)')).test(node.className) // Boolean 518 518 } 519 519 520 520 dojo.addClass = function(/*HTMLElement*/node, /*String*/classStr){ 521 // summary 522 // Adds the specified classes to the end of the class list on the523 // passed node.524 if (!dojo.hasClass(node, classStr)){521 // summary: 522 // Adds the specified classes to the end of the class list on the 523 // passed node. 524 if(!dojo.hasClass(node, classStr)){ 525 525 node.className = node.className + (node.className ? ' ' : '') + classStr; 526 526 } … … 528 528 529 529 dojo.removeClass = function(/*HTMLElement*/node, /*String*/classStr){ 530 // summary 531 // Removes classes from node. 530 // summary: Removes classes from node. 532 531 node.className = node.className.replace(new RegExp('(^|\\s+)'+classStr+'(\\s+|$)'), "$1$2"); 533 532 }