瀏覽代碼

Ticket #5282 - Buttons in block (DesignBox) tabs.

AntonLV 9 月之前
父節點
當前提交
2739a070bb
共有 3 個文件被更改,包括 8 次插入 和 4 次删除
  1. 1 1
      template/designbox_menu.html
  2. 1 1
      template/designbox_menu_button.html
  3. 6 2
      template/scripts/BxBaseFunctions.php

+ 1 - 1
template/designbox_menu.html

@@ -1,3 +1,3 @@
 <div class="bx-db-menu">
-    <div class="bx-db-menu-tab bx-db-menu-tab-btn__class__">__content__</div>
+    <div class="bx-db-menu-tab bx-db-menu-tab-btn__class__ space-x-2">__content__</div>
 </div>

+ 1 - 1
template/designbox_menu_button.html

@@ -1,4 +1,4 @@
-<a href="javascript:void(0);" __attrs__>
+<a __attrs__>
     <bx_if:show_icon><i class="sys-icon __icon__"></i></bx_if:show_icon>
     <bx_if:show_icon_a><i class="sys-icon-a" data-rotate="down" data-icon="__icon_a__"></i></bx_if:show_icon_a>
     <bx_if:show_title>__title__</bx_if:show_title>

+ 6 - 2
template/scripts/BxBaseFunctions.php

@@ -508,9 +508,13 @@ class BxBaseFunctions extends BxDolFactory implements iBxDolSingleton
                         continue;
                 }
 
-                $aAttrs = array();
-                if(!empty($aButton['onclick']))
+                $aAttrs = [];
+                if(!empty($aButton['href']))
+                    $aAttrs['href'] = $aButton['href'];
+                if(!empty($aButton['onclick'])) {
+                    $aAttrs['href'] = "javascript:void(0);";
                     $aAttrs['onclick'] = $aButton['onclick'];
+                }
                 
                 $aAttrs['class'] = 'bx-btn bx-btn-small';
                 if(!empty($aButton['class']))