[jQuery] [blockUI] Permit jQuery-wrapped DOM elements not currently in DOM as messages

[jQuery] [blockUI] Permit jQuery-wrapped DOM elements not currently in DOM as messages


Currently blockUI makes the assumption that any jQuery element that is
passed in is a 'real' DOM element. To fix this, also check that the
element also has a parent when performing operations on the parent.
Since this list doesn't appear to have file-posting capability...
here's an inlined patch to jquery.blockUI.js ... if attributions
needed, attribute to "Thomas Harning <thomas.harning@trustbearer.com>"
--- jquery.blockUI.js?v2.10    2008-10-22 19:42:20.000000000 -0400
+++ jquery.block.js    2008-12-05 11:02:09.000000000 -0500
@@ -133,7 +133,8 @@
data.parent = node.parentNode;
data.display = node.style.display;
data.position = node.style.position;
- data.parent.removeChild(node);
+ if(data.parent)
+ data.parent.removeChild(node);
}
var z = opts.baseZ;
@@ -244,7 +245,8 @@
if (data && data.el) {
data.el.style.display = data.display;
data.el.style.position = data.position;
- data.parent.appendChild(data.el);
+ if(data.parent)
+ data.parent.appendChild(data.el);
$(data.el).removeData('blockUI.history');
}
if (typeof opts.onUnblock == 'function')