mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Append colgroup and col elements (#1044)
This commit is contained in:
parent
74a8e20623
commit
5c54a4b8ee
7
src/jquery/coreTest.js
vendored
7
src/jquery/coreTest.js
vendored
@ -356,7 +356,7 @@ test("wrap(String|Element)", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("append(String|Element|Array<Element>|jQuery)", function() {
|
test("append(String|Element|Array<Element>|jQuery)", function() {
|
||||||
expect(14);
|
expect(16);
|
||||||
var defaultText = 'Try them out:'
|
var defaultText = 'Try them out:'
|
||||||
var result = $('#first').append('<b>buga</b>');
|
var result = $('#first').append('<b>buga</b>');
|
||||||
ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
|
ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
|
||||||
@ -412,6 +412,11 @@ test("append(String|Element|Array<Element>|jQuery)", function() {
|
|||||||
$('#select1').append('<OPTION>Test</OPTION>');
|
$('#select1').append('<OPTION>Test</OPTION>');
|
||||||
ok( $('#select1 option:last').text() == "Test", "Appending <OPTION> (all caps)" );
|
ok( $('#select1 option:last').text() == "Test", "Appending <OPTION> (all caps)" );
|
||||||
|
|
||||||
|
$('#table').append('<colgroup></colgroup>');
|
||||||
|
ok( $('#table colgroup').length, "Append colgroup" );
|
||||||
|
|
||||||
|
$('#table colgroup').append('<col>');
|
||||||
|
ok( $('#table colgroup col').length, "Append col" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("appendTo(String|Element|Array<Element>|jQuery)", function() {
|
test("appendTo(String|Element|Array<Element>|jQuery)", function() {
|
||||||
|
5
src/jquery/jquery.js
vendored
5
src/jquery/jquery.js
vendored
@ -1465,7 +1465,7 @@ jQuery.extend({
|
|||||||
!s.indexOf("<leg") &&
|
!s.indexOf("<leg") &&
|
||||||
[1, "<fieldset>", "</fieldset>"] ||
|
[1, "<fieldset>", "</fieldset>"] ||
|
||||||
|
|
||||||
(!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot")) &&
|
(!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot") || !s.indexOf("<colg")) &&
|
||||||
[1, "<table>", "</table>"] ||
|
[1, "<table>", "</table>"] ||
|
||||||
|
|
||||||
!s.indexOf("<tr") &&
|
!s.indexOf("<tr") &&
|
||||||
@ -1475,6 +1475,9 @@ jQuery.extend({
|
|||||||
(!s.indexOf("<td") || !s.indexOf("<th")) &&
|
(!s.indexOf("<td") || !s.indexOf("<th")) &&
|
||||||
[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
|
[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
|
||||||
|
|
||||||
|
!s.indexOf("<col") &&
|
||||||
|
[2, "<table><colgroup>", "</colgroup></table>"] ||
|
||||||
|
|
||||||
[0,"",""];
|
[0,"",""];
|
||||||
|
|
||||||
// Go to html and back, then peel off extra wrappers
|
// Go to html and back, then peel off extra wrappers
|
||||||
|
Loading…
Reference in New Issue
Block a user