From 689d63f4871d96300d492fa5ab9d25301070efba Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Tue, 19 Oct 2010 09:29:20 +0400 Subject: [PATCH 1/3] Return control of $ and jQuery only if it is really necessary. This make jQuery.noConflict() callable anytime. --- src/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.js b/src/core.js index 99521d91c..f701a20c1 100644 --- a/src/core.js +++ b/src/core.js @@ -373,9 +373,9 @@ jQuery.extend = jQuery.fn.extend = function() { jQuery.extend({ noConflict: function( deep ) { - window.$ = _$; + if ( window.$ === jQuery ) window.$ = _$; - if ( deep ) { + if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } From 1ac7b459a4defb8238309ae47afb3637719cf8be Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Mon, 22 Nov 2010 08:12:12 +0400 Subject: [PATCH 2/3] respect source guidelines --- src/core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core.js b/src/core.js index f701a20c1..4cc5eea10 100644 --- a/src/core.js +++ b/src/core.js @@ -373,7 +373,9 @@ jQuery.extend = jQuery.fn.extend = function() { jQuery.extend({ noConflict: function( deep ) { - if ( window.$ === jQuery ) window.$ = _$; + if ( window.$ === jQuery ) { + window.$ = _$; + } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; From dd79199a08b9b69d139606619b818c429e0540c3 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Mon, 22 Nov 2010 08:12:12 +0400 Subject: [PATCH 3/3] fix to follow current source style --- src/core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core.js b/src/core.js index f701a20c1..4cc5eea10 100644 --- a/src/core.js +++ b/src/core.js @@ -373,7 +373,9 @@ jQuery.extend = jQuery.fn.extend = function() { jQuery.extend({ noConflict: function( deep ) { - if ( window.$ === jQuery ) window.$ = _$; + if ( window.$ === jQuery ) { + window.$ = _$; + } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery;