Changeset 1047
- Timestamp:
- 10/02/08 16:24:11 (2 months ago)
- Files:
-
- 1 modified
-
trunk/XinhaCore.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/XinhaCore.js
r1046 r1047 4286 4286 /** Traverses the DOM upwards and returns the first element that is of one of the specified types 4287 4287 * @param {Selection} sel Selection object as returned by getSelection 4288 * @param {Array} types Array of HTML tag names (lower case)4288 * @param {Array} types Array of matching criteria. Each criteria is either a string containing the tag name, or a callback used to select the element. 4289 4289 * @returns {DomNode|null} 4290 4290 */ … … 4318 4318 return prnt; 4319 4319 } 4320 if ( types.contains(prnt.tagName.toLowerCase()) ) 4321 { 4320 for (var index=0; index<types.length; ++index) { 4321 if (typeof types[index] == 'string' && types[index] == prnt.tagName.toLowerCase()){ 4322 // Criteria is a tag name. It matches 4322 4323 return prnt; 4323 4324 } 4325 else if (typeof types[index] == 'function' && types[index](this, prnt)) { 4326 // Criteria is a callback. It matches 4327 return prnt; 4328 } 4329 } 4330 4324 4331 if ( prnt.tagName.toLowerCase() == 'body' ) 4325 4332 {
