mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 00:11:35 +02:00
Show tooltip for long texts in datatable
This commit is contained in:
parent
e936e9ccef
commit
52911841ff
@ -98,4 +98,14 @@ class EntityDatatable
|
|||||||
|
|
||||||
return $str . ' <span class="fa fa-file-o" data-toggle="tooltip" data-placement="bottom" title="' . e($note) . '"></span>';
|
return $str . ' <span class="fa fa-file-o" data-toggle="tooltip" data-placement="bottom" title="' . e($note) . '"></span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function showWithTooltip($str, $max = 60) {
|
||||||
|
$str = e($str);
|
||||||
|
|
||||||
|
if (strlen($str) > $max) {
|
||||||
|
return '<span data-toggle="tooltip" data-placement="bottom" title="' . $str . '">' . trim(substr($str, 0, $max)) . '...' . '</span>';
|
||||||
|
} else {
|
||||||
|
return $str;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ class ExpenseDatatable extends EntityDatatable
|
|||||||
[
|
[
|
||||||
'public_notes',
|
'public_notes',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return $model->public_notes != null ? e(substr($model->public_notes, 0, 100)) : '';
|
return $this->showWithTooltip($model->public_notes);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -98,7 +98,7 @@ class RecurringExpenseDatatable extends EntityDatatable
|
|||||||
[
|
[
|
||||||
'public_notes',
|
'public_notes',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return $model->public_notes != null ? substr($model->public_notes, 0, 100) : '';
|
return $this->showWithTooltip($model->public_notes, 100);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -64,7 +64,7 @@ class RecurringInvoiceDatatable extends EntityDatatable
|
|||||||
[
|
[
|
||||||
'private_notes',
|
'private_notes',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return e($model->private_notes);
|
return $this->showWithTooltip($model->private_notes);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -20,7 +20,7 @@ class SubscriptionDatatable extends EntityDatatable
|
|||||||
[
|
[
|
||||||
'target',
|
'target',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return e(substr($model->target, 0, 40) . (strlen($model->target) > 40 ? '...' : ''));
|
return $this->showWithTooltip($model->target, 40);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -59,7 +59,7 @@ class TaskDatatable extends EntityDatatable
|
|||||||
[
|
[
|
||||||
'description',
|
'description',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return e(substr($model->description, 0, 80) . (strlen($model->description) > 80 ? '...' : ''));
|
return $this->showWithTooltip($model->description);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
Loading…
Reference in New Issue
Block a user