Procházet zdrojové kódy

#273 Cover image area: styles for the image

Alex Trofimov před 10 roky
rodič
revize
928ed07df5

+ 3 - 4
inc/classes/BxDolCover.php

@@ -25,10 +25,9 @@
  * @code
  *  $oCover = BxDolCover::getInstance(); // get object instance
  *  if ($oCover) // check if Cover is available for using
- *      $oCover->set ( // set cover with default template
- *          'text' => 'Hello World!',
- *          'image_url' => 'http://example.com/tile.png',
- *      ); 
+ *      $oCover->set (array( // set cover with default template
+ *          'title' => 'Hello World!',
+ *      )); 
  * @endcode
  *
  */

+ 1 - 1
template/cover.html

@@ -14,7 +14,7 @@
         <div class="bx-cover-title bx-def-margin-sec-topbottom bx-def-font-h1">
 
             <bx_if:icon><i class="sys-icon bx-def-font-contrasted __icon__"></i></bx_if:icon>
-            <bx_if:image><img style="background-image:url(__icon_url__)" src="<bx_icon_url:spacer.gif />" /></bx_if:image>
+            <bx_if:image><img class="bx-def-border bx-def-round-corners" style="background-image:url(__icon_url__)" src="<bx_icon_url:spacer.gif />" /></bx_if:image>
 
             <span class="bx-def-font-contrasted bx-def-margin-sec-left">__title__</span>
 

+ 12 - 0
template/css/cover.css

@@ -17,6 +17,7 @@
 
 .bx-cover-title {
     font-weight:bold;
+    vertical-align:middle;
     text-shadow:0 0 0.125rem rgba(0, 0, 0, .5);
 }
 
@@ -25,6 +26,17 @@
     float:none;
 }
 
+.bx-cover-title img {
+    width:3rem;
+    height:3rem;
+    background-size: cover;
+    vertical-align: middle;
+}
+
+.bx-cover-title span {
+    vertical-align: middle;
+}
+
 .bx-cover-homepage {
     background-image: url(../images/cover-homepage.png);
 }

+ 1 - 1
template/scripts/BxBaseCover.php

@@ -34,7 +34,7 @@ class BxBaseCover extends BxDolCover
     {
         $this->_addJsCss();
 
-        if (!$this->_aOptions || !$this->_sTemplateName) {
+        if (!$this->_aOptions) {
 
             $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
             $mixedOptions = $oMenuSubmenu->getParamsForCover();