mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-06 09:34:13 +01:00
N°3123 - Fix popup menus for lists
This commit is contained in:
@@ -1864,6 +1864,7 @@ class MenuBlock extends DisplayBlock
|
||||
}
|
||||
|
||||
$oActionsBlock = new Toolbar("ibo-action-toolbar-{$sId}", 'ibo-action-toolbar');
|
||||
$oRenderBlock->AddSubBlock($oActionsBlock);
|
||||
$sMenuTogglerId = "ibo-actions-menu-toggler-{$sId}";
|
||||
$sPopoverMenuId = "ibo-other-action-popover-{$sId}";
|
||||
|
||||
@@ -1886,8 +1887,6 @@ $('#{$sMenuTogglerId}').on('click', function(oEvent) {
|
||||
var popover = $("#{$sPopoverMenuId}");
|
||||
|
||||
popover.css({
|
||||
// 'top': (aEventTargetPos.top + parseInt(oEventTarget.css('marginTop'), 10) + oEventTarget.height()) + 'px',
|
||||
// 'left': (aEventTargetPos.left + parseInt(oEventTarget.css('marginLeft'), 10) + oEventTarget.width() - popover.width()) + 'px',
|
||||
'top': (aEventTargetPos.top + oEventTarget.outerHeight(true)) + 'px',
|
||||
'left': (aEventTargetPos.left + oEventTarget.outerWidth(true) - popover.width()) + 'px',
|
||||
'z-index': 10060
|
||||
@@ -1954,7 +1953,7 @@ JS
|
||||
}
|
||||
}
|
||||
|
||||
return $oActionsBlock;
|
||||
return $oRenderBlock;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1187,7 +1187,6 @@ class utils
|
||||
public static function GetPopupMenuItemsBlock($iMenuId, $param, &$aActions, $sDataTableId = null)
|
||||
{
|
||||
$oBlock = new UIContentBlock();
|
||||
$aActions = [];
|
||||
// 1st - add standard built-in menu items
|
||||
//
|
||||
switch($iMenuId)
|
||||
@@ -1201,9 +1200,9 @@ class utils
|
||||
$sOQL = addslashes($param->GetFilter()->ToOQL(true));
|
||||
$sFilter = urlencode($param->GetFilter()->serialize());
|
||||
$sUrl = utils::GetAbsoluteUrlAppRoot()."pages/$sUIPage?operation=search&filter=".$sFilter."&{$sContext}";
|
||||
$oBlock->AddJsFileRelPath(utils::GetAbsoluteUrlAppRoot().'js/tabularfieldsselector.js');
|
||||
$oBlock->AddJsFileRelPath(utils::GetAbsoluteUrlAppRoot().'js/jquery.dragtable.js');
|
||||
$oBlock->AddCssFileRelPath(utils::GetAbsoluteUrlAppRoot().'css/dragtable.css');
|
||||
$oBlock->AddJsFileRelPath('js/tabularfieldsselector.js');
|
||||
$oBlock->AddJsFileRelPath('js/jquery.dragtable.js');
|
||||
$oBlock->AddCssFileRelPath('css/dragtable.css');
|
||||
|
||||
$aResult = array();
|
||||
if (strlen($sUrl) < SERVER_MAX_URL_LENGTH)
|
||||
@@ -1236,12 +1235,12 @@ class utils
|
||||
$oObj = $param;
|
||||
$sOQL = "SELECT ".get_class($oObj)." WHERE id=".$oObj->GetKey();
|
||||
$sUrl = ApplicationContext::MakeObjectUrl(get_class($oObj), $oObj->GetKey());
|
||||
$oBlock->AddJsFileRelPath(utils::GetAbsoluteUrlAppRoot().'js/tabularfieldsselector.js');
|
||||
$oBlock->AddJsFileRelPath(utils::GetAbsoluteUrlAppRoot().'js/jquery.dragtable.js');
|
||||
$oBlock->AddCssFileRelPath(utils::GetAbsoluteUrlAppRoot().'css/dragtable.css');
|
||||
$oBlock->AddJsFileRelPath(utils::GetAbsoluteUrlAppRoot().'js/tabularfieldsselector.js');
|
||||
$oBlock->AddJsFileRelPath(utils::GetAbsoluteUrlAppRoot().'js/jquery.dragtable.js');
|
||||
$oBlock->AddCssFileRelPath(utils::GetAbsoluteUrlAppRoot().'css/dragtable.css');
|
||||
$oBlock->AddJsFileRelPath('js/tabularfieldsselector.js');
|
||||
$oBlock->AddJsFileRelPath('js/jquery.dragtable.js');
|
||||
$oBlock->AddCssFileRelPath('css/dragtable.css');
|
||||
$oBlock->AddJsFileRelPath('js/tabularfieldsselector.js');
|
||||
$oBlock->AddJsFileRelPath('js/jquery.dragtable.js');
|
||||
$oBlock->AddCssFileRelPath('css/dragtable.css');
|
||||
|
||||
$aResult = array(
|
||||
new SeparatorPopupMenuItem(),
|
||||
|
||||
21
pages/UI.php
21
pages/UI.php
@@ -229,22 +229,13 @@ function DisplaySearchSet($oP, $oFilter, $bSearchForm = true, $sBaseClass = '',
|
||||
}
|
||||
if ($bDoSearch)
|
||||
{
|
||||
if (strtolower($sFormat) == 'csv')
|
||||
{
|
||||
$oBlock = new DisplayBlock($oFilter, 'csv', false);
|
||||
// Adjust the size of the Textarea containing the CSV to fit almost all the remaining space
|
||||
$oP->add_ready_script(" $('#1>textarea').height($('#1').parent().height() - $('#0').outerHeight() - 30).width( $('#1').parent().width() - 20);"); // adjust the size of the block
|
||||
}
|
||||
else
|
||||
{
|
||||
$oBlock = new DisplayBlock($oFilter, 'list', false);
|
||||
$oBlock = new DisplayBlock($oFilter, 'list', false);
|
||||
|
||||
// Breadcrumb
|
||||
//$iCount = $oBlock->GetDisplayedCount();
|
||||
$sPageId = "ui-search-".$oFilter->GetClass();
|
||||
$sLabel = MetaModel::GetName($oFilter->GetClass());
|
||||
$oP->SetBreadCrumbEntry($sPageId, $sLabel, '', '', 'fas fa-search', iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES);
|
||||
}
|
||||
// Breadcrumb
|
||||
//$iCount = $oBlock->GetDisplayedCount();
|
||||
$sPageId = "ui-search-".$oFilter->GetClass();
|
||||
$sLabel = MetaModel::GetName($oFilter->GetClass());
|
||||
$oP->SetBreadCrumbEntry($sPageId, $sLabel, '', '', 'fas fa-search', iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES);
|
||||
if ($bSearchForm) {
|
||||
//add search block
|
||||
$sTableId = utils::ReadParam('_table_id_', null, false, 'raw_data');
|
||||
|
||||
@@ -107,7 +107,7 @@ abstract class UIBlock implements iUIBlock
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function GetJsFilesRelPaths() {
|
||||
return static::JS_FILES_REL_PATH;
|
||||
return array_merge(static::JS_FILES_REL_PATH, $this->aJsFilesRelPath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user