|
46 | 46 | * - [`contents()`](http://api.jquery.com/contents/)
|
47 | 47 | * - [`css()`](http://api.jquery.com/css/)
|
48 | 48 | * - [`data()`](http://api.jquery.com/data/)
|
| 49 | + * - [`detach()`](http://api.jquery.com/detach/) |
49 | 50 | * - [`empty()`](http://api.jquery.com/empty/)
|
50 | 51 | * - [`eq()`](http://api.jquery.com/eq/)
|
51 | 52 | * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name
|
@@ -437,6 +438,12 @@ function jqLiteEmpty(element) {
|
437 | 438 | }
|
438 | 439 | }
|
439 | 440 |
|
| 441 | +function jqLiteRemove(element, keepData) { |
| 442 | + if (!keepData) jqLiteDealoc(element); |
| 443 | + var parent = element.parentNode; |
| 444 | + if (parent) parent.removeChild(element); |
| 445 | +} |
| 446 | + |
440 | 447 | //////////////////////////////////////////
|
441 | 448 | // Functions which are declared directly.
|
442 | 449 | //////////////////////////////////////////
|
@@ -536,7 +543,7 @@ forEach({
|
536 | 543 | return jqLiteInheritedData(element, '$injector');
|
537 | 544 | },
|
538 | 545 |
|
539 |
| - removeAttr: function(element,name) { |
| 546 | + removeAttr: function(element, name) { |
540 | 547 | element.removeAttribute(name);
|
541 | 548 | },
|
542 | 549 |
|
@@ -890,10 +897,10 @@ forEach({
|
890 | 897 | wrapNode.appendChild(element);
|
891 | 898 | },
|
892 | 899 |
|
893 |
| - remove: function(element) { |
894 |
| - jqLiteDealoc(element); |
895 |
| - var parent = element.parentNode; |
896 |
| - if (parent) parent.removeChild(element); |
| 900 | + remove: jqLiteRemove, |
| 901 | + |
| 902 | + detach: function(element) { |
| 903 | + jqLiteRemove(element, true); |
897 | 904 | },
|
898 | 905 |
|
899 | 906 | after: function(element, newElement) {
|
|
0 commit comments