From a7ee896adb0a31bc74073ae5aaa7909d6672110a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 19 Feb 2014 17:18:54 +0000 Subject: [PATCH] create wrapper only for overflow != "visible", not needed otherwise and can break existing code, eg. name popup in addressbook.edit --- etemplate/js/et2_widget_grid.js | 37 ++++++--------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/etemplate/js/et2_widget_grid.js b/etemplate/js/et2_widget_grid.js index 34c680f128..9f2c10bb6b 100644 --- a/etemplate/js/et2_widget_grid.js +++ b/etemplate/js/et2_widget_grid.js @@ -771,15 +771,16 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned], * * Grid needs special handling because HTML tables don't do overflow. We * create a wrapper DIV to handle it. + * No value or default visible needs no wrapper, as table is always overflow visible. * - * @param {string} _value Overflow value, must be a valid CSS overflow value. + * @param {string} _value Overflow value, must be a valid CSS overflow value, default 'visible' */ set_overflow: function(_value) { var wrapper = this.wrapper || this.table.parent('[id$="_grid_wrapper"]'); this.overflow = _value; - if(wrapper.length == 0 && _value) + if(wrapper.length == 0 && _value && _value !== 'visible') { this.wrapper = wrapper = this.table.wrap('
').parent(); if(this.height) @@ -788,39 +789,13 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned], } } wrapper.css('overflow', _value); - - if(wrapper.length && (!_value || _value == null)) + + if(wrapper.length && (!_value || _value == null || _value === 'visible')) { this.table.unwrap(); } }, - /** - * Set the height attribute - * - * Grid needs special handling because HTML tables don't care about height. We - * create a wrapper DIV to handle it. - * - * @param {string} _value Height value, must be a valid CSS height value. - */ - set_height: function(_value) { - - this.height = _value; - - // Height without overflow does nothing. - // This also makes sure that the wrapper is there. - if(!this.overflow) - { - this.set_overflow('hidden'); - } - var wrapper = this.wrapper || this.table.parent('[id$="_grid_wrapper"]'); - - if(wrapper.length > 0 && _value) - { - wrapper.css('height', this.height); - } - }, - set_align: function(_value) { this.align = _value; }, @@ -941,7 +916,7 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned], // Add a new action object to the object manager var row = $j('tr', this.tbody)[i]; var aoi = new et2_action_object_impl(this, row); - + var obj = widget_object.addObject("row_"+i, aoi); obj.updateActionLinks(action_links); }