summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-03-07 16:10:47 +0100
committerThomas Bruederli <thomas@roundcube.net>2014-03-07 16:10:47 +0100
commit817c98ec3b11fefeb055611592de7c898751e087 (patch)
tree1125cf51d1090bf04f6fe5f99c8382b2adf0644d /program
parent143ceff0d83c53000dd29c2047d204c08dba9de7 (diff)
Add method to reset a treelist widget
Diffstat (limited to 'program')
-rw-r--r--program/js/treelist.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/program/js/treelist.js b/program/js/treelist.js
index d940e396c..d56e7b8c9 100644
--- a/program/js/treelist.js
+++ b/program/js/treelist.js
@@ -56,6 +56,7 @@ function rcube_treelist_widget(node, p)
this.collapse = collapse;
this.select = select;
this.render = render;
+ this.reset = reset;
this.drag_start = drag_start;
this.drag_end = drag_end;
this.intersects = intersects;
@@ -314,6 +315,20 @@ function rcube_treelist_widget(node, p)
}
/**
+ *
+ */
+ function reset()
+ {
+ select('');
+
+ data = [];
+ indexbyid = {};
+ drag_active = false;
+
+ container.html('');
+ }
+
+ /**
* Render the tree list from the internal data structure
*/
function render()