chg: [genericElements:index_table] Moved description to a tooltip
Description describing indexes are great when discovering an app for the first time but start taking important place and become useless when users gets to know the app better. Moving it to a tooltip makes sense in that regard.pull/93/head
parent
509b203591
commit
7cf7363009
|
@ -999,6 +999,8 @@ class BoostrapIcon extends BootstrapGeneric {
|
||||||
private $icon = '';
|
private $icon = '';
|
||||||
private $defaultOptions = [
|
private $defaultOptions = [
|
||||||
'class' => [],
|
'class' => [],
|
||||||
|
'title' => '',
|
||||||
|
'params' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
function __construct($icon, $options=[]) {
|
function __construct($icon, $options=[]) {
|
||||||
|
@ -1019,12 +1021,13 @@ class BoostrapIcon extends BootstrapGeneric {
|
||||||
|
|
||||||
private function genIcon()
|
private function genIcon()
|
||||||
{
|
{
|
||||||
$html = $this->genNode('span', [
|
$html = $this->genNode('span', array_merge([
|
||||||
'class' => array_merge(
|
'class' => array_merge(
|
||||||
is_array($this->options['class']) ? $this->options['class'] : [$this->options['class']],
|
is_array($this->options['class']) ? $this->options['class'] : [$this->options['class']],
|
||||||
["fa fa-{$this->icon}"]
|
["fa fa-{$this->icon}"]
|
||||||
),
|
),
|
||||||
]);
|
'title' => h($this->options['title'])
|
||||||
|
], $this->options['params']));
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Cake\Utility\Text;
|
||||||
/*
|
/*
|
||||||
* echo $this->element('/genericElements/IndexTable/index_table', [
|
* echo $this->element('/genericElements/IndexTable/index_table', [
|
||||||
* 'top_bar' => (
|
* 'top_bar' => (
|
||||||
|
@ -36,12 +38,18 @@
|
||||||
$tableRandomValue = Cake\Utility\Security::randomString(8);
|
$tableRandomValue = Cake\Utility\Security::randomString(8);
|
||||||
echo '<div id="table-container-' . h($tableRandomValue) . '">';
|
echo '<div id="table-container-' . h($tableRandomValue) . '">';
|
||||||
if (!empty($data['title'])) {
|
if (!empty($data['title'])) {
|
||||||
echo sprintf('<h2 class="fw-light">%s</h2>', h($data['title']));
|
echo Text::insert(
|
||||||
}
|
'<h2 class="fw-light">:title :help</h2>',
|
||||||
if (!empty($data['description'])) {
|
[
|
||||||
echo sprintf(
|
'title' => h($data['title']),
|
||||||
'<div class="fw-light">%s</div>',
|
'help' => $this->Bootstrap->icon('info', [
|
||||||
empty($data['description']) ? '' : h($data['description'])
|
'class' => ['fs-6', 'align-text-top',],
|
||||||
|
'title' => empty($data['description']) ? '' : h($data['description']),
|
||||||
|
'params' => [
|
||||||
|
'data-bs-toggle' => 'tooltip',
|
||||||
|
]
|
||||||
|
]),
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
echo '<div class="panel">';
|
echo '<div class="panel">';
|
||||||
|
@ -158,11 +166,18 @@
|
||||||
$(this).addClass('fa-eye');
|
$(this).addClass('fa-eye');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
||||||
|
var tooltipList = tooltipTriggerList.map(function(tooltipTriggerEl) {
|
||||||
|
return new bootstrap.Tooltip(tooltipTriggerEl)
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
function getMultiSelectData($topbar) {
|
function getMultiSelectData($topbar)
|
||||||
|
{
|
||||||
foreach ($topbar['children'] as $child) {
|
foreach ($topbar['children'] as $child) {
|
||||||
if (!empty($child['type']) && $child['type'] == 'multi_select_actions') {
|
if (!empty($child['type']) && $child['type'] == 'multi_select_actions') {
|
||||||
return $child;
|
return $child;
|
||||||
|
|
Loading…
Reference in New Issue