mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-24 18:30:23 +00:00
ignore jqLite#append for doc fragment
this is needed to be compatible with jqQuery 1.5.1
This commit is contained in:
parent
56c00800c7
commit
a2c4271128
2 changed files with 7 additions and 1 deletions
|
|
@ -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);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue