/* AdvancedReports Widget */
Vtiger_Widget_Js('Vtiger_AdvancedReportsWidget_Widget_Js', {

}, {
    postLoadWidget: function() {
        // this._super();
        this.adjustHeight();
    },

    postResizeWidget: function() {
        // this._super();
        this.adjustHeight();
    },

    adjustHeight: function() {
        var parent = this.getContainer();

        // Retrieve header, footer and content in container context
        var widgetHeader = jQuery('.dashboardWidgetHeader', parent);
        var widgetFooter = jQuery('.dashBoardWidgetFooter', parent);
        var widgetContent = jQuery('.dashboardWidgetContent', parent);

        // Content height should be content container height without header and footer (10px is margin/padding correction)
        var adjustedHeight = parent.height() - widgetHeader.height() - widgetFooter.height() + 10;
        // Set new widget height
        widgetContent.css({height: adjustedHeight});
    }
});