EasyUI Forum

General Category => Bug Report => Topic started by: omhardb on June 17, 2015, 09:36:02 AM



Title: Bug when add cls in region center of layout
Post by: omhardb on June 17, 2015, 09:36:02 AM
If you try to add a class in the region center of a layout, the panel don't put in the correct place. It seems that is in the bottom of the window.

You can check this issue in the following link: http://jsfiddle.net/omhardb/yLwd4kvn/

Maybe the problem is because the "layout-panel" and "layout-panel-center" classes are losing when you add a new class in the region center.

Please check this problem and give a solution as soon as posible.

Regards,


Title: Re: Bug when add cls in region center of layout
Post by: jarry on June 18, 2015, 12:32:47 AM
To solve this issue, please override the $.fn.layout.parsePanelOptions function.
Code:
<script type="text/javascript">
$.fn.layout.parsePanelOptions = function(target){
var t = $(target);
var opts = $.extend({}, $.fn.panel.parseOptions(target),
$.parser.parseOptions(target, [
'region',{split:'boolean',collpasedSize:'number',minWidth:'number',minHeight:'number',maxWidth:'number',maxHeight:'number'}
]));
var dir = opts.region || 'center';
return $.extend({}, opts, {
cls: ('layout-panel layout-panel-'+dir+' '+(opts.cls||'')),
bodyCls: ('layout-body '+(opts.bodyCls||''))
});
};
</script>

The updated example is available from http://jsfiddle.net/yLwd4kvn/1/.


Title: Re: Bug when add cls in region center of layout
Post by: omhardb on June 18, 2015, 01:17:20 PM
Thanks for the solution ;D

Are you planning to include this solution in the next version?


Title: Re: Bug when add cls in region center of layout
Post by: jarry on June 18, 2015, 11:46:59 PM
Yes, this solution will be integrated into next version 1.4.3.