From: Jörn Zaefferer Date: Sat, 16 Sep 2006 15:16:42 +0000 (+0000) Subject: Resolved bug #191 as won't fix, removed the failing test and changed docs accordingly. X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=df11c1b76c8a0213be031d23d81e10ec4c28e658;p=jquery.git Resolved bug #191 as won't fix, removed the failing test and changed docs accordingly. --- diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 69628b3..c3185bb 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -587,19 +587,17 @@ jQuery.fn = jQuery.prototype = { * and finds the deepest ancestor element within its * structure - it is that element that will en-wrap everything else. * + * This does not work with elements that contain text. Any necessary text + * must be added after the wrapping is done. + * * @example $("p").wrap("
"); * @before

Test Paragraph.

* @result

Test Paragraph.

* * @test var defaultText = 'Try them out:' * var result = $('#first').wrap('
').text(); - * ok( defaultText == result, 'Check for simple wrapping' ); - * ok( $('#first').parent().parent().is('.red'), 'Check if wrapper div has class "red"' ); - * - * @test var defaultText = 'Try them out:' - * var result = $('#first').wrap('
xxyy
').text() - * ok( 'xx' + defaultText + 'yy' == result, 'Check for wrapping' ); - * ok( $('#first').parent().parent().is('.red'), 'Check if wrapper div has class "red"' ); + * ok( defaultText == result, 'Check for wrapping of on-the-fly html' ); + * ok( $('#first').parent().parent().is('.red'), 'Check if wrapper has class "red"' ); * * @name wrap * @type jQuery @@ -617,9 +615,17 @@ jQuery.fn = jQuery.prototype = { * provided and finding the deepest ancestor element within its * structure - it is that element that will en-wrap everything else. * - * @example $("p").wrap("
"); - * @before

Test Paragraph.

- * @result

Test Paragraph.

+ * This does not work with elements that contain text. Any necessary text + * must be added after the wrapping is done. + * + * @example $("p").wrap( document.getElementById('content') ); + * @before

Test Paragraph.

+ * @result

Test Paragraph.

+ * + * @test var defaultText = 'Try them out:' + * var result = $('#first').wrap(document.getElementById('empty')).parent(); + * ok( result.is('ol'), 'Check for element wrapping' ); + * ok( result.text() == defaultText, 'Check for element wrapping' ); * * @name wrap * @type jQuery