RomanL 6 лет назад
Родитель
Сommit
818c8db10d

+ 1 - 1
inc/classes/BxDolTemplate.php

@@ -1118,7 +1118,7 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
             ));
 
         //--- Use iconic font.
-        return $this->parseIcon($mixedId);
+        return $this->parseIcon($mixedId, $aParams);
     }
 
     /**

+ 5 - 2
modules/base/general/template/css/main.css

@@ -246,7 +246,6 @@ div.bx-badge {
 	display: flex;
     align-items:center;
 	text-align: center;
-    background:#ff0000;
     color:#fff;	
 	max-width: 9rem;
     min-width: 1.25rem;
@@ -275,7 +274,7 @@ div.bx-badge span{
 	text-overflow: ellipsis; 
     overflow: hidden;
 }
-div.bx-badge .sys-icon{
+div.bx-badge:not(.bx-badge-compact-to) .sys-icon{
 	color:#fff;
 	margin-right: 0.5rem;
 }
@@ -283,6 +282,10 @@ div.bx-badge.bx-badge-compact{
 	width: 1.25rem;
 	text-align: center;
 }
+div.bx-badge.bx-badge-compact-to{
+	padding: 0;
+	width: auto;
+}
 div.bx-badge.bx-badge-compact .sys-icon{
 	width: 1.25rem;
 }

+ 1 - 1
template/badge.html

@@ -1,4 +1,4 @@
-<div class="bx-badge bx-def-font-small __class__" __style__ title="__title__">
+<div class="bx-badge bx-def-font-small __class__" style = "__style_font__ __style_bg__" title="__title__">
     <bx_if:icon>
         __content__
     </bx_if:icon>

+ 15 - 3
template/scripts/BxBaseServices.php

@@ -448,11 +448,22 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
     public function serviceGetBadge($aBadge, $bIsCompact = false)
     {
         $sClass = '';
+		$sStyleFont = '';
+		$sStyleBg = '';
+		if ($aBadge['color'] == '')
+			$aBadge['color'] = '#ff0000';
+		
         if ($bIsCompact){
             $aBadge['is_icon_only'] = 1;
+			$sClass .= ' bx-badge-compact-to';
+			$sStyleFont = 'color: ' . $aBadge['color'];
         }
+		else{
+			$sStyleBg = 'background-color: ' . $aBadge['color'];
+		}
+		
         if ($aBadge['is_icon_only'] == 1){
-            $sClass = 'bx-badge-compact';
+            $sClass .= ' bx-badge-compact';
         }
         
         return BxDolTemplate::getInstance()->parseHtmlByName('badge.html', array(
@@ -462,10 +473,11 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
             ),
             'bx_if:icon' => array(
                 'condition' => $aBadge['icon'] != '',
-                'content' => array('content' => BxDolTemplate::getInstance()->getIcon($aBadge['icon'], array('class' => 'bx-badge-icon'))),
+                'content' => array('content' => BxDolTemplate::getInstance()->getIcon($aBadge['icon'], array('class' => 'bx-badge-icon sys-colored', 'style' => $sStyleFont))),
             ),
             'title' => $aBadge['text'],
-            'style' => $aBadge['color'] != '' ? 'style = "background-color: ' . $aBadge['color'] . '"' : '',
+			'style_font' => $sStyleFont,
+			'style_bg' => $sStyleBg,
             'class' => $sClass,
             )
     	);