Skip to content
Permalink
Browse files
Make sure that the removeEvent and buildFragment private functions ar…
…e exposed (to help with access across modules). The final API for each of these is very much in flux and will likely change before the final release. Fixes #7011.
  • Loading branch information
jeresig committed Sep 8, 2010
1 parent bca5765 commit acb162a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
@@ -109,7 +109,7 @@ jQuery.fn = jQuery.prototype = {
}

} else {
ret = buildFragment( [ match[1] ], [ doc ] );
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
}

@@ -239,7 +239,7 @@ jQuery.event = {
// remove generic event handler if no more handlers exist
if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
removeEvent( elem, type, elemData.handle );
jQuery.removeEvent( elem, type, elemData.handle );
}

ret = null;
@@ -527,7 +527,7 @@ jQuery.event = {
}
};

var removeEvent = document.removeEventListener ?
jQuery.removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
@@ -327,7 +327,7 @@ jQuery.fn.extend({
results = { fragment: parent };

} else {
results = buildFragment( args, this, scripts );
results = jQuery.buildFragment( args, this, scripts );
}

fragment = results.fragment;
@@ -392,7 +392,7 @@ function cloneCopyEvent(orig, ret) {
});
}

function buildFragment( args, nodes, scripts ) {
jQuery.buildFragment = function( args, nodes, scripts ) {
var fragment, cacheable, cacheresults,
doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);

@@ -422,7 +422,7 @@ function buildFragment( args, nodes, scripts ) {
}

return { fragment: fragment, cacheable: cacheable };
}
};

jQuery.fragments = {};

@@ -569,7 +569,7 @@ jQuery.extend({
jQuery.event.remove( elem, type );

} else {
removeEvent( elem, type, data.handle );
jQuery.removeEvent( elem, type, data.handle );
}
}
}
@@ -134,7 +134,7 @@

// release memory in IE
root = script = div = all = a = null;
})();
})( jQuery );

jQuery.props = {
"for": "htmlFor",

2 comments on commit acb162a

@jdalton
Copy link
Member

@jdalton jdalton commented on acb162a Sep 9, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be interested in what you decide for a name. My current name for it is fuse.dom.getFragmentFromHTML(), it's not really intended for public API use but it does sit exposed. I am totally open to suggestions, although mine returns a fragment or a single element so ya naming is hard :P

@jdalton
Copy link
Member

@jdalton jdalton commented on acb162a Sep 9, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how much losing private variables will hurt minification like undefined and window and all those. Maybe when loaded as modules minification is less important as it's separate smaller chunks. I know @getify is doing a lot of research in that area and has produced results that suggest separate minified files severed up is faster than 1 minified file.

Please sign in to comment.