Ox.$: remove removeOxElement
This commit is contained in:
parent
8f5ff8c6ee
commit
4cf10359ef
1 changed files with 0 additions and 17 deletions
|
@ -64,19 +64,6 @@ Ox.$ = Ox.element = function $(value) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeOxElements(parent, includeParent) {
|
|
||||||
return;
|
|
||||||
if (includeParent) {
|
|
||||||
removeOxElement(parent);
|
|
||||||
} else {
|
|
||||||
Ox.$(parent).find('.OxElement').forEach(removeOxElement);
|
|
||||||
}
|
|
||||||
function removeOxElement(element) {
|
|
||||||
var $element = Ox.getOxElement(element);
|
|
||||||
$element && $element.removeElement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return elements.length ? Ox.extend(
|
return elements.length ? Ox.extend(
|
||||||
Ox.zipObject(Ox.range(elements.length), elements
|
Ox.zipObject(Ox.range(elements.length), elements
|
||||||
), {
|
), {
|
||||||
|
@ -339,7 +326,6 @@ Ox.$ = Ox.element = function $(value) {
|
||||||
return html;
|
return html;
|
||||||
} else {
|
} else {
|
||||||
elements.forEach(function(element) {
|
elements.forEach(function(element) {
|
||||||
removeOxElements(element);
|
|
||||||
element.innerHTML = string;
|
element.innerHTML = string;
|
||||||
});
|
});
|
||||||
return this;
|
return this;
|
||||||
|
@ -598,7 +584,6 @@ Ox.$ = Ox.element = function $(value) {
|
||||||
remove: function remove() {
|
remove: function remove() {
|
||||||
elements.forEach(function(element) {
|
elements.forEach(function(element) {
|
||||||
if (element.parentNode) {
|
if (element.parentNode) {
|
||||||
removeOxElements(element, true);
|
|
||||||
element.parentNode.removeChild(element);
|
element.parentNode.removeChild(element);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -648,7 +633,6 @@ Ox.$ = Ox.element = function $(value) {
|
||||||
var parent = otherElement.parentNode,
|
var parent = otherElement.parentNode,
|
||||||
sibling = otherElement.nextSibling;
|
sibling = otherElement.nextSibling;
|
||||||
if (parent) {
|
if (parent) {
|
||||||
removeOxElements(otherElement, true);
|
|
||||||
parent.removeChild(otherElement);
|
parent.removeChild(otherElement);
|
||||||
elements.forEach(function(element) {
|
elements.forEach(function(element) {
|
||||||
parent.insertBefore(element, sibling)
|
parent.insertBefore(element, sibling)
|
||||||
|
@ -668,7 +652,6 @@ Ox.$ = Ox.element = function $(value) {
|
||||||
var parent = element.parentNode,
|
var parent = element.parentNode,
|
||||||
sibling = element.nextSibling;
|
sibling = element.nextSibling;
|
||||||
if (parent) {
|
if (parent) {
|
||||||
removeOxElements(element, true);
|
|
||||||
parent.removeChild(element);
|
parent.removeChild(element);
|
||||||
getElements($other).forEach(function(otherElement) {
|
getElements($other).forEach(function(otherElement) {
|
||||||
parent.insertBefore(otherElement, sibling);
|
parent.insertBefore(otherElement, sibling);
|
||||||
|
|
Loading…
Reference in a new issue