From 5f62f9aed3826f2c276ab7a2da2ed0fdb90e38e6 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 14 Oct 2018 09:16:55 +0200 Subject: [PATCH] added link to go down DN level --- lam/templates/lib/500_lam.js | 8 +++++--- lam/templates/misc/ajax.php | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lam/templates/lib/500_lam.js b/lam/templates/lib/500_lam.js index 782d89a0..9a1ed75f 100644 --- a/lam/templates/lib/500_lam.js +++ b/lam/templates/lib/500_lam.js @@ -1044,13 +1044,15 @@ window.lam.html.showDnSelection = function(fieldId, title, okText, cancelText, t .done(function(jsonData) { jQuery('#dlg_' + fieldId).html(jsonData.dialogData); var buttonList = {}; - buttonList[cancelText] = function() { jQuery(this).dialog("close"); }; + buttonList[cancelText] = function() { jQuery(this).dialog("destroy"); }; jQuery('#dlg_' + fieldId).dialog({ modal: true, title: title, dialogClass: 'defaultBackground', buttons: buttonList, - width: 'auto' + width: 'auto', + maxHeight: 600, + position: {my: 'center', at: 'center', of: window} }); }); }; @@ -1066,7 +1068,7 @@ window.lam.html.selectDn = function(el, fieldId) { var field = jQuery('#' + fieldId); var dn = jQuery(el).parents('.row').data('dn'); field.val(dn); - jQuery('#dlg_' + fieldId).dialog("close"); + jQuery('#dlg_' + fieldId).dialog("destroy"); return false; } diff --git a/lam/templates/misc/ajax.php b/lam/templates/misc/ajax.php index 93bcd56f..5c6c718d 100644 --- a/lam/templates/misc/ajax.php +++ b/lam/templates/misc/ajax.php @@ -221,6 +221,9 @@ class Ajax { private function buildDnSelectionHtml($dnList, $currentDn) { $fieldId = trim($_POST['fieldId']); $mainRow = new htmlResponsiveRow(); + $onclickUp = 'window.lam.html.updateDnSelection(this, \'' + . htmlspecialchars($fieldId) . '\', \'' . getSecurityTokenName() . '\', \'' + . getSecurityTokenValue() . '\')'; if (!empty($currentDn)) { $row = new htmlResponsiveRow(); $row->addDataAttribute('dn', $currentDn); @@ -236,9 +239,6 @@ class Ajax { $row->add($button, 12, 3); $mainRow->add($row, 12); // back up - $onclickUp = 'window.lam.html.updateDnSelection(this, \'' - . htmlspecialchars($fieldId) . '\', \'' . getSecurityTokenName() . '\', \'' - . getSecurityTokenValue() . '\')'; $row = new htmlResponsiveRow(); $row->addDataAttribute('dn', extractDNSuffix($currentDn)); $text = new htmlLink('..', '#'); @@ -257,7 +257,9 @@ class Ajax { foreach ($dnList as $dn) { $row = new htmlResponsiveRow(); $row->addDataAttribute('dn', $dn); - $row->add(new htmlOutputText($dn), 12, 9); + $link = new htmlLink($dn, '#'); + $link->setOnClick($onclickUp); + $row->add($link, 12, 9); $row->setCSSClasses(array('text-right')); $buttonId = base64_encode($dn); $buttonId = str_replace('=', '', $buttonId);