From d0ec225b932c40cfacd1343b7d4b1f3f7f6ab39d Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Tue, 13 Dec 2022 10:02:24 +0100 Subject: [PATCH] update card + button --- docs/50_Components/Card.md | 10 +++++----- public_html/classes/render-adminlte.class.php | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/50_Components/Card.md b/docs/50_Components/Card.md index 99d0bd8..2cb8563 100644 --- a/docs/50_Components/Card.md +++ b/docs/50_Components/Card.md @@ -33,11 +33,11 @@ Set to true to show it; default: none of it is visible Key | Description --- | --- -tb-collaps | -tb-expand | it is added automatically if you set 'state'=>'collapsed' -tb-maximize | -tb-minimize | it is added automatically if you set 'state'=>'maximized' -tb-remove | +tb-collapse | show minus icon to collapse widget +tb-expand | show plus button to expand; it is added automatically if you set 'state'=>'collapsed' +tb-maximize | show maximize button +tb-minimize | show minimize button; it is added automatically if you set 'state'=>'maximized' +tb-remove | show cross button to remove widget Content: diff --git a/public_html/classes/render-adminlte.class.php b/public_html/classes/render-adminlte.class.php index f6fa69e..c48847c 100755 --- a/public_html/classes/render-adminlte.class.php +++ b/public_html/classes/render-adminlte.class.php @@ -476,13 +476,15 @@ class renderadminlte { public function getButton($aOptions){ $aOptions=$this->_ensureOptions($aOptions, ['type', 'size', 'class', 'text', 'icon']); $aElement=$aOptions; - $aElement['class']='btn ' + $aElement['class']='btn' .($aOptions['class'] ? ' '.$aOptions['class'] : '') .($aOptions['type'] ? ' btn-'.$aOptions['type'] : '') .($aOptions['size'] ? ' btn-'.$aOptions['size'] : '') ; $aElement['label']=$aOptions['text'] ? $aOptions['text'] : ' '; - unset($aElement['_infos']); + foreach(['_infos', 'type', 'size', 'icon', 'text'] as $sDeleteKey){ + unset($aElement[$sDeleteKey]); + } return $this->_tag('button', $aElement); } @@ -530,7 +532,7 @@ class renderadminlte { * - state - one of [none]|collapsed|maximized * * >> toolbar icons - set to true to show it; default: none of it is visible - * - tb-collaps + * - tb-collapse * - tb-expand it is added automatically if you set 'state'=>'collapsed' * - tb-maximize * - tb-minimize it is added automatically if you set 'state'=>'maximized' @@ -559,7 +561,7 @@ class renderadminlte { 'maximized'=>[ 'class'=>'maximized-card', 'tool'=>'tb-minimize'], ]; $aTools=[ - 'tb-collaps'=>'<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-minus"></i></button>', + 'tb-collapse'=>'<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-minus"></i></button>', 'tb-expand'=>'<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-plus"></i></button>', 'tb-maximize'=>'<button type="button" class="btn btn-tool" data-card-widget="maximize"><i class="fas fa-expand"></i></button>', -- GitLab