diff options
| author | Vidhin Mehta (OpenERP) <vme@tinyerp.com> | 2012-07-02 17:49:27 +0530 |
|---|---|---|
| committer | Vidhin Mehta (OpenERP) <vme@tinyerp.com> | 2012-07-02 17:49:27 +0530 |
| commit | 9e952c3fba9b4f0cd6399d3ba24f17e98b6f0560 (patch) | |
| tree | 5b643adbe76db28e71cd31380d9b7984b57ee277 /addons/web/static/src/js/view_tree.js | |
| parent | 871cb1ac24dea1555db0ae9b8f7fc4441212b067 (diff) | |
[IMP]implement css and collapse all functionality.
bzr revid: vme@tinyerp.com-20120702121927-wbg5pncvw4qo8cni
Diffstat (limited to 'addons/web/static/src/js/view_tree.js')
| -rw-r--r-- | addons/web/static/src/js/view_tree.js | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js index e8bd7351f1f..363bf6258f1 100644 --- a/addons/web/static/src/js/view_tree.js +++ b/addons/web/static/src/js/view_tree.js @@ -112,7 +112,12 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie $select.change(); } }); - + this.$element.find("#tree_view_expand").click(function(){ + self.expand_all(); + }); + this.$element.find("#tree_view_collapse").click(function(){ + self.collpase_all(); + }); // TODO store open nodes in url ?... this.do_push_state({}); @@ -128,6 +133,17 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie return [color, py.parse(py.tokenize(expr)), expr]; }).value(); }, + expand_all: function(){ + }, + collpase_all: function(){ + var self = this; + var root_tr = this.$element.find(".oe-treeview-table tbody tr[data-level='"+1+"']"); + _.each(root_tr,function(rec){ + if($(rec).hasClass('oe_open')){ + self.showcontent($(rec).attr('data-id'),false); + } + }); + }, /** * Returns the color for the provided record in the current view (from the * ``@colors`` attribute) @@ -259,13 +275,5 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie }, this); }, - do_show: function () { - this.$element.show(); - }, - - do_hide: function () { - this.$element.hide(); - this.hidden = true; - } }); }; |
