Skip to content
Snippets Groups Projects
Commit 18c5f854 authored by mcmlxxix's avatar mcmlxxix
Browse files

added tree.onOpen() and tree.onClose() event emitters. ex: tree.onOpen =...

added tree.onOpen() and tree.onClose() event emitters. ex: tree.onOpen = function() { do something when tree is opened };
parent 23bcec5d
No related branches found
No related tags found
No related merge requests found
...@@ -356,14 +356,18 @@ function Tree(frame,text,tree) { ...@@ -356,14 +356,18 @@ function Tree(frame,text,tree) {
this.open = function() { this.open = function() {
if(properties.status&flags.CLOSED) { if(properties.status&flags.CLOSED) {
properties.status&=~flags.CLOSED; properties.status&=~flags.CLOSED;
} if(typeof this.onOpen == "function")
this.onOpen();
this.refresh(); this.refresh();
}
return true; return true;
} }
this.close = function() { this.close = function() {
if(properties.status&flags.CLOSED) if(properties.status&flags.CLOSED)
return false; return false;
properties.status|=flags.CLOSED; properties.status|=flags.CLOSED;
if(typeof this.onClose == "function")
this.onClose();
this.refresh(); this.refresh();
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment