/* This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. */ (function() { 'use strict'; Sao.Tab = Sao.class_(Object, { init: function() { Sao.Tab.tabs.push(this); this.buttons = {}; this.id = 'tab-' + Sao.Tab.counter++; this.name_el = jQuery(''); }, create_tabcontent: function() { this.el = jQuery('
', { 'class': this.class_ }); var toolbar = this.create_toolbar().appendTo(this.el); this.title = toolbar.find('.title'); this.content = jQuery('
').appendTo(this.el); if (this.info_bar) { this.el.append(this.info_bar.el); } }, set_menu: function(menu) { this.menu_def().forEach(function(definition) { var icon = definition[0]; var name = definition[1]; var func = definition[2]; var item = jQuery('
  • ', { 'role': 'presentation' }).appendTo(menu); var link = jQuery('', { 'role': 'menuitem', 'href': '#', 'tabindex': -1 }).append(jQuery('', { 'class': 'glyphicon ' + icon, 'aria-hidden': 'true' })).append(' ' + name).appendTo(item); if (func) { link.click(function() { this[func](); }.bind(this)); } else { item.addClass('disabled'); } }.bind(this)); }, create_toolbar: function() { var toolbar = jQuery('