git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added change note for #979
[jquery.git]
/
src
/
jquery
/
jquery.js
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
3522f8c
..
81b5b64
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-824,7
+824,9
@@
jQuery.fn = jQuery.prototype = {
*/
clone: function(deep) {
return this.pushStack( jQuery.map( this, function(a){
*/
clone: function(deep) {
return this.pushStack( jQuery.map( this, function(a){
- return a.cloneNode( deep != undefined ? deep : true );
+ var a = a.cloneNode( deep != undefined ? deep : true );
+ a.$events = null; // drop $events expando to avoid firing incorrect events
+ return a;
}) );
},
}) );
},
@@
-1280,7
+1282,7
@@
jQuery.extend({
prop: function(elem, value, type, index, prop){
// Handle executable functions
if ( jQuery.isFunction( value ) )
prop: function(elem, value, type, index, prop){
// Handle executable functions
if ( jQuery.isFunction( value ) )
- return value.call( elem, [index] );
+ value = value.call( elem, [index] );
// exclude the following css properties to add px
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
// exclude the following css properties to add px
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
@@
-1311,6
+1313,8
@@
jQuery.extend({
// internal only, use is(".class")
has: function( t, c ) {
t = t.className || t;
// internal only, use is(".class")
has: function( t, c ) {
t = t.className || t;
+ // escape regex characters
+ c = c.replace(/([\.\\\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1");
return t && new RegExp("(^|\\s)" + c + "(\\s|$)").test( t );
}
},
return t && new RegExp("(^|\\s)" + c + "(\\s|$)").test( t );
}
},
@@
-1470,7
+1474,7
@@
jQuery.extend({
if ( arg.length === 0 )
return;
if ( arg.length === 0 )
return;
- if ( arg[0] == undefined || (jQuery.browser.msie && jQuery.nodeName(arg,"form")) )
+ if ( arg[0] == undefined )
r.push( arg );
else
r = jQuery.merge( r, arg );
r.push( arg );
else
r = jQuery.merge( r, arg );
@@
-1525,7
+1529,7
@@
jQuery.extend({
// IE elem.getAttribute passes even for style
else if ( elem.tagName ) {
if ( value != undefined ) elem.setAttribute( name, value );
// IE elem.getAttribute passes even for style
else if ( elem.tagName ) {
if ( value != undefined ) elem.setAttribute( name, value );
- if ( jQuery.browser.msie && !jQuery.isXMLDoc(elem) && /^(href|src|background|cite|classid|codebase|data|longdesc|profile|usemap)$/.test(name) )
+ if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) )
return elem.getAttribute( name, 2 );
return elem.getAttribute( name );
return elem.getAttribute( name, 2 );
return elem.getAttribute( name );