N°2847 Add Separator item to popover menu items

This commit is contained in:
Stephen Abello
2020-08-04 13:49:11 +02:00
parent d6ab310d24
commit f4f846496b
6 changed files with 54 additions and 0 deletions

View File

@@ -20,6 +20,10 @@
$ibo-popover-menu--item--text-color: $ibo-color-grey-900 !default;
$ibo-popover-menu--item--hyperlink-color: $ibo-popover-menu--item--text-color !default;
$ibo-popover-menu--separator--padding: 0;
$ibo-popover-menu--separator--margin: 0;
$ibo-popover-menu--separator--background-color: $ibo-color-grey-200;
.ibo-popover-menu--item{
padding: 12px 24px 12px 16px;
color: $ibo-popover-menu--item--text-color;
@@ -31,4 +35,9 @@ $ibo-popover-menu--item--hyperlink-color: $ibo-popover-menu--item--text-color !d
background-color: var(--ibo-color-grey-200);
color: inherit;
}
&.ibo-popover-menu--separator{
padding: $ibo-popover-menu--separator--padding;
margin: $ibo-popover-menu--separator--margin;
background-color: $ibo-popover-menu--separator--background-color
}
}

View File

@@ -157,6 +157,7 @@ return array(
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\PopoverMenuItem\\JsPopoverMenuItem' => $baseDir . '/sources/application/UI/Component/PopoverMenu/PopoverMenuItem/JsPopoverMenuItem.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\PopoverMenuItem\\PopoverMenuItem' => $baseDir . '/sources/application/UI/Component/PopoverMenu/PopoverMenuItem/PopoverMenuItem.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\PopoverMenuItem\\PopoverMenuItemFactory' => $baseDir . '/sources/application/UI/Component/PopoverMenu/PopoverMenuItem/PopoverMenuItemFactory.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\PopoverMenuItem\\SeparatorPopoverMenuItem' => $baseDir . '/sources/application/UI/Component/PopoverMenu/PopoverMenuItem/SeparatorPopoverMenuItem.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\PopoverMenuItem\\UrlPopoverMenuItem' => $baseDir . '/sources/application/UI/Component/PopoverMenu/PopoverMenuItem/UrlPopoverMenuItem.php',
'Combodo\\iTop\\Application\\UI\\Component\\QuickCreate\\QuickCreate' => $baseDir . '/sources/application/UI/Component/QuickCreate/QuickCreate.php',
'Combodo\\iTop\\Application\\UI\\Component\\QuickCreate\\QuickCreateFactory' => $baseDir . '/sources/application/UI/Component/QuickCreate/QuickCreateFactory.php',

View File

@@ -387,6 +387,7 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\PopoverMenuItem\\JsPopoverMenuItem' => __DIR__ . '/../..' . '/sources/application/UI/Component/PopoverMenu/PopoverMenuItem/JsPopoverMenuItem.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\PopoverMenuItem\\PopoverMenuItem' => __DIR__ . '/../..' . '/sources/application/UI/Component/PopoverMenu/PopoverMenuItem/PopoverMenuItem.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\PopoverMenuItem\\PopoverMenuItemFactory' => __DIR__ . '/../..' . '/sources/application/UI/Component/PopoverMenu/PopoverMenuItem/PopoverMenuItemFactory.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\PopoverMenuItem\\SeparatorPopoverMenuItem' => __DIR__ . '/../..' . '/sources/application/UI/Component/PopoverMenu/PopoverMenuItem/SeparatorPopoverMenuItem.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\PopoverMenuItem\\UrlPopoverMenuItem' => __DIR__ . '/../..' . '/sources/application/UI/Component/PopoverMenu/PopoverMenuItem/UrlPopoverMenuItem.php',
'Combodo\\iTop\\Application\\UI\\Component\\QuickCreate\\QuickCreate' => __DIR__ . '/../..' . '/sources/application/UI/Component/QuickCreate/QuickCreate.php',
'Combodo\\iTop\\Application\\UI\\Component\\QuickCreate\\QuickCreateFactory' => __DIR__ . '/../..' . '/sources/application/UI/Component/QuickCreate/QuickCreateFactory.php',

View File

@@ -24,6 +24,7 @@ namespace Combodo\iTop\Application\UI\Component\PopoverMenu\PopoverMenuItem;
use ApplicationPopupMenuItem;
use JSPopupMenuItem;
use URLPopupMenuItem;
use SeparatorPopupMenuItem;
/**
* Class PopupMenuItemFactory
@@ -52,6 +53,9 @@ class PopoverMenuItemFactory
break;
case $oItem instanceof JSPopupMenuItem:
$sTargetClass = 'JsPopoverMenuItem';
break;
case $oItem instanceof SeparatorPopupMenuItem:
$sTargetClass = 'SeparatorPopoverMenuItem';
break;
default:
$sTargetClass = 'PopoverMenuItem';

View File

@@ -0,0 +1,35 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
namespace Combodo\iTop\Application\UI\Component\PopoverMenu\PopoverMenuItem;
/**
* Class SeparatorPopoverMenuItem
*
* @author Stephen Abello <stephen.abello@combodo.com>
* @package Combodo\iTop\Application\UI\Component\PopoverMenu\PopoverMenuItem
* @property \SeparatorPopupMenuItem $oPopupMenuItem
* @since 2.8.0
*/
class SeparatorPopoverMenuItem extends PopoverMenuItem
{
const HTML_TEMPLATE_REL_PATH = 'components/popover-menu/item/mode_separator';
}

View File

@@ -0,0 +1,4 @@
{% extends 'components/popover-menu/item/layout.html.twig' %}
{% block iboPopoverMenuItem %}
<hr class="ibo-popover-menu--item ibo-popover-menu--separator">
{% endblock %}