diff --git a/application/ui.extkeywidget.class.inc.php b/application/ui.extkeywidget.class.inc.php index 73c0994f7..71c75d0bf 100644 --- a/application/ui.extkeywidget.class.inc.php +++ b/application/ui.extkeywidget.class.inc.php @@ -267,7 +267,8 @@ EOF $oPage->add("

".MetaModel::GetClassIcon($this->sTargetClass)." ".Dict::Format('UI:CreationTitle_Class', MetaModel::GetName($this->sTargetClass))."

\n"); cmdbAbstractObject::DisplayCreationForm($oPage, $this->sTargetClass, null, array(), array('formPrefix' => $this->iId, 'noRelations' => true)); $oPage->add(''); - $oPage->add_ready_script("\$('#ac_create_$this->iId').dialog({ width: $(window).width()*0.8, height: 'auto', autoOpen: false, modal: true, title: '$sDialogTitle'});\n"); +// $oPage->add_ready_script("\$('#ac_create_$this->iId').dialog({ width: $(window).width()*0.8, height: 'auto', autoOpen: false, modal: true, title: '$sDialogTitle'});\n"); + $oPage->add_ready_script("\$('#ac_create_$this->iId').dialog({ width: 'auto', height: 'auto', autoOpen: false, modal: true, title: '$sDialogTitle'});\n"); $oPage->add_ready_script("$('#dcr_{$this->iId} form').removeAttr('onsubmit');"); $oPage->add_ready_script("$('#dcr_{$this->iId} form').bind('submit.uilinksWizard', oACWidget_{$this->iId}.DoCreateObject);"); } diff --git a/js/extkeywidget.js b/js/extkeywidget.js index 6ee794aef..2bc2f42a6 100644 --- a/js/extkeywidget.js +++ b/js/extkeywidget.js @@ -54,6 +54,15 @@ function ExtKeyWidget(id, sClass, sAttCode, sSuffix, bSelectMode, oWizHelper) this.UpdateSizes = function() { var dlg = $('#ac_dlg_'+me.id); + // Adjust the dialog's size to fit into the screen + if (dlg.width() > ($(window).width()-40)) + { + dlg.width($(window).width()-40); + } + if (dlg.height() > ($(window).height()-70)) + { + dlg.height($(window).height()-70); + } var searchForm = dlg.find('div.display_block:first'); // Top search form, enclosing display_block var results = $('#dr_'+me.id); padding_right = parseInt(dlg.css('padding-right').replace('px', '')); @@ -224,6 +233,15 @@ function ExtKeyWidget(id, sClass, sAttCode, sSuffix, bSelectMode, oWizHelper) // Modify the action of the cancel button $('#ac_create_'+me.id+' button.cancel').unbind('click').click( me.CloseCreateObject ); me.ajax_request = null; + // Adjust the dialog's size to fit into the screen + if ($('#ac_create_'+me.id).width() > ($(window).width()-40)) + { + $('#ac_create_'+me.id).width($(window).width()-40); + } + if ($('#ac_create_'+me.id).height() > ($(window).height()-70)) + { + $('#ac_create_'+me.id).height($(window).height()-70); + } }, 'html' ); diff --git a/pages/UI.php b/pages/UI.php index 746dfdd38..2668b94e0 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -420,12 +420,16 @@ function DisplayWelcomePopup(WebPage $oP) $sTitle = addslashes(Dict::S('UI:WelcomeMenu:Title')); $oP->add_ready_script( << ($(window).height()-70)) + { + $('#welcome_popup').height($(window).height()-70); + } EOF ); $_SESSION['welcome'] = 'ok';