drop jQuery support completely from knockoutjs

This commit is contained in:
djmaze 2020-09-21 16:11:06 +02:00
parent 06abbf0713
commit 1cd07955a2
5 changed files with 110 additions and 140 deletions

View file

@ -28,9 +28,6 @@ ko.utils.domNodeDisposal = new (function () {
// Erase the DOM data
ko.utils.domData.clear(node);
// Perform cleanup needed by external libraries (currently only jQuery, but can be extended)
ko.utils.domNodeDisposal["cleanExternalData"](node);
// Clear any immediate-child comment nodes, as these wouldn't have been found by
// node.getElementsByTagName("*") in cleanNode() (comment nodes aren't elements)
if (cleanableNodeTypesWithDescendants[node.nodeType]) {
@ -86,14 +83,6 @@ ko.utils.domNodeDisposal = new (function () {
ko.cleanNode(node);
if (node.parentNode)
node.parentNode.removeChild(node);
},
'cleanExternalData' : function (node) {
// Special support for jQuery here because it's so commonly used.
// Many jQuery plugins (including jquery.tmpl) store data using jQuery's equivalent of domData
// so notify it to tear down any resources associated with the node & descendants here.
if (jQuery && jQuery['cleanData'])
jQuery['cleanData']([node]);
}
};
})();