From bc349253cff1de6a224554767e1001342409172f Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Tue, 7 Dec 2021 15:19:49 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B04481=20Fix=20hierarchical=20key=20browse?= =?UTF-8?q?r=20bottom=20buttons=20position?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/ui.extkeywidget.class.inc.php | 38 +++++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/application/ui.extkeywidget.class.inc.php b/application/ui.extkeywidget.class.inc.php index a347966fa..c14f1875d 100644 --- a/application/ui.extkeywidget.class.inc.php +++ b/application/ui.extkeywidget.class.inc.php @@ -1010,14 +1010,40 @@ JS { $oPage->add('
'.Dict::S("UI:Treeview:CollapseAll").' | '.Dict::S("UI:Treeview:ExpandAll").'
'); } - - $oPage->add("iId}\" value=\"".Dict::S('UI:Button:Cancel')."\" onClick=\"$('#dlg_tree_{$this->iId}').dialog('close');\">  "); - $oPage->add("iId}\" value=\"".Dict::S('UI:Button:Ok')."\" onClick=\"oACWidget_{$this->iId}.DoHKOk();\">"); - + $oPage->add(''); - + + $sOkButtonLabel = Dict::S('UI:Button:Ok'); + $sCancelButtonLabel = Dict::S('UI:Button:Cancel'); $oPage->add_ready_script("\$('#tree_$this->iId ul').treeview({ control: '#treecontrolid', persist: 'false'});\n"); - $oPage->add_ready_script("\$('#dlg_tree_$this->iId').dialog({ width: 'auto', height: 'auto', autoOpen: true, modal: true, title: '$sDialogTitle', resizeStop: oACWidget_{$this->iId}.OnHKResize, close: oACWidget_{$this->iId}.OnHKClose });\n"); + $oPage->add_ready_script(<<iId').dialog({ + width: 'auto', + height: 'auto', + autoOpen: true, + modal: true, + title: '$sDialogTitle', + create: function() { + $(this).css("maxHeight", $(window).height()*0.8); + }, + buttons: [ + { + text: "$sOkButtonLabel", + class: "ibo-is-primary", + click: function() { + oACWidget_{$this->iId}.DoHKOk(); + }, + }, + { + text: "$sCancelButtonLabel", + click: function() { $(this).dialog( "close" ); } }, + ], + + resizeStop: oACWidget_{$this->iId}.OnHKResize, + close: oACWidget_{$this->iId}.OnHKClose +}); +JS + ); } /**