ignore jqLite#append for doc fragment

this is needed to be compatible with jqQuery 1.5.1
This commit is contained in:
Igor Minar 2011-03-31 01:19:07 -07:00
parent 56c00800c7
commit a2c4271128
2 changed files with 7 additions and 1 deletions

View file

@ -342,7 +342,8 @@ forEach({
append: function(element, node) {
forEach(new JQLite(node), function(child){
element.appendChild(child);
if (element.nodeType === 1)
element.appendChild(child);
});
},

View file

@ -299,6 +299,11 @@ describe('jqLite', function(){
expect(root.append('text')).toEqual(root);
expect(root.html()).toEqual('text');
});
it('should not append anything if parent node is not of type element', function() {
var root = jqLite(document.createDocumentFragment());
expect(root.append('<p>foo</p>')).toBe(root);
expect(root.children().length).toBe(0);
});
});
describe('remove', function(){
it('should remove', function(){