MCPcopy Index your code
hub / github.com/prototypejs/prototype / extend

Function extend

src/prototype/dom/dom.js:3252–3266  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

elementIsExtendedFunction · 0.85
extendElementWithFunction · 0.85
getUniqueElementIDFunction · 0.70

Tested by

no test coverage detected