* Element.extend(element) -> Element * * Extends the given element instance with all of the Prototype goodness and * syntactic sugar, as well as any extensions added via [[Element.addMethods]]. * (If the element instance was already extended, this is a no-op.) * * You only nee
(element)
| 3250 | * will also be extended with the methods from `Form.Methods`. |
| 3251 | **/ |
| 3252 | function extend(element) { |
| 3253 | if (!element || elementIsExtended(element)) return element; |
| 3254 | if (element.nodeType !== Node.ELEMENT_NODE || element == window) |
| 3255 | return element; |
| 3256 | |
| 3257 | var methods = Object.clone(Methods), |
| 3258 | tagName = element.tagName.toUpperCase(); |
| 3259 | |
| 3260 | // Add methods for specific tags. |
| 3261 | if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); |
| 3262 | |
| 3263 | extendElementWith(element, methods); |
| 3264 | EXTENDED[getUniqueElementID(element)] = true; |
| 3265 | return element; |
| 3266 | } |
| 3267 | |
| 3268 | // Because of the deficiency mentioned above, IE8 needs a very thin version |
| 3269 | // of Element.extend that acts like Prototype.K _except_ when the element |
nothing calls this directly
no test coverage detected