From 76c0b261983c07147e875f41be9fdf54e7bc9063 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 12 Jul 2012 11:55:17 +0200 Subject: [PATCH] [ADD] Added doc to breadcrumb items callback bzr revid: fme@openerp.com-20120712095517-itzfdh52fd0zuzi4 --- addons/web/static/src/js/views.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 62adafb2c05..bf385ff97f3 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -34,16 +34,36 @@ instance.web.ActionManager = instance.web.Widget.extend({ } item.id = _.uniqueId('breadcrumb_'); _.defaults(item, { - show: function() { + show: function(index) { + /* + * This callback is used whenever the widget should be shown. + * If multiple titles are used, the index can be used in order + * to define which item of the breadcrumb has been trigerred. + */ item.widget.$element.show(); }, hide: function() { + /* + * This callback is used whenever the widget should be hidden. + * Called on the last pushed item before pusing a new + * breadcrumb. + */ item.widget.$element.hide(); }, destroy: function() { + /* + * This callback is used whenever the widget should be + * destroyed. Happens when the breadcrumb is cleared. + */ item.widget.destroy(); }, get_title: function() { + /* + * Should return the title of the widget as a string. If an + * array is returned, multiple titles can be used (eg: a + * widget switching views). The #show() callback will receive + * the index of the selected title. + */ return item.title || item.widget.get('title'); } });