mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
support elements with some but not all $uihooks
This commit is contained in:
@@ -6,21 +6,21 @@
|
||||
// not a separate property on the DOM element.
|
||||
|
||||
var removeNode = function (n) {
|
||||
if (n.nodeType === 1 && n.parentNode.$uihooks)
|
||||
if (n.nodeType === 1 && n.parentNode.$uihooks && n.parentNode.$uihooks.removeElement)
|
||||
n.parentNode.$uihooks.removeElement(n);
|
||||
else
|
||||
n.parentNode.removeChild(n);
|
||||
};
|
||||
|
||||
var insertNode = function (n, parent, next) {
|
||||
if (n.nodeType === 1 && parent.$uihooks)
|
||||
if (n.nodeType === 1 && parent.$uihooks && parent.$uihooks.insertElement)
|
||||
parent.$uihooks.insertElement(n, parent, next);
|
||||
else
|
||||
parent.insertBefore(n, next || null);
|
||||
};
|
||||
|
||||
var moveNode = function (n, parent, next) {
|
||||
if (n.nodeType === 1 && parent.$uihooks)
|
||||
if (n.nodeType === 1 && parent.$uihooks && parent.$uihooks.moveElement)
|
||||
parent.$uihooks.moveElement(n, parent, next);
|
||||
else
|
||||
parent.insertBefore(n, next || null);
|
||||
|
||||
Reference in New Issue
Block a user