mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Add some more methods to the fake DOM
These methods are needed to get static saving working in the browser again (click "Save Static" in the Demo tiddler)
This commit is contained in:
parent
08f278624b
commit
c72a63849b
@ -39,6 +39,23 @@ TW_Element.prototype.appendChild = function(node) {
|
||||
node.parentNode = this;
|
||||
};
|
||||
|
||||
TW_Element.prototype.removeChild = function(node) {
|
||||
var p = this.children.indexOf(node);
|
||||
if(p !== -1) {
|
||||
this.children.splice(p,1);
|
||||
}
|
||||
};
|
||||
|
||||
TW_Element.prototype.hasChildNodes = function() {
|
||||
return !!this.children.length;
|
||||
};
|
||||
|
||||
Object.defineProperty(TW_Element.prototype, "firstChild", {
|
||||
get: function() {
|
||||
return this.children[0];
|
||||
}
|
||||
});
|
||||
|
||||
TW_Element.prototype.addEventListener = function(type,listener,useCapture) {
|
||||
// Do nothing
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user