create wrapper only for overflow != "visible", not needed otherwise and can break existing code, eg. name popup in addressbook.edit

This commit is contained in:
Ralf Becker 2014-02-19 17:18:54 +00:00
parent 530ebec63f
commit a7ee896adb

View File

@ -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('<div id="'+this.id+'_grid_wrapper"></div>').parent();
if(this.height)
@ -789,38 +790,12 @@ 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;
},