X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/29a9bfd9b61771b41ca18de2a53b672cb3c07cf1..fb3b7d9bff29aa5c99298ce9e4bae53c2eb47a7d:/src/smartxml/smartxml.js diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 749d4f4..de70e9b 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -177,8 +177,12 @@ $.extend(ElementNode.prototype, { nodeType: Node.ELEMENT_NODE, setData: function(key, value) { - if(value !== undefined) { - this._$.data(key, value); + if(arguments.length === 2) { + if(_.isUndefined(value)) { + this._$.removeData(key); + } else { + this._$.data(key, value); + } } else { this._$.removeData(_.keys(this._$.data())); this._$.data(key);