From 3d9b7c06a150eff0d6c7798bd6327239c59bd60f Mon Sep 17 00:00:00 2001 From: Prasoon Dwivedi Date: Wed, 30 Dec 2020 20:32:33 +0530 Subject: [PATCH] Add tooltip to the elements of the target table Tooltip has been added to the `First Name`, 'Last Name', `Email` and `Position` columns of the targets table in the group modal while creating and editing a group. Right now if any of the above-mentioned elements is more than 15 characters in length it is truncated and suffixed with an ellipsis. This at times creates confusion while viewing groups that have targets similar first name, last name, email, etc. With this commit, a small pop-up box with the complete value of the element will appear whenever that element is hovered over by the mouse. --- static/js/src/app/groups.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/static/js/src/app/groups.js b/static/js/src/app/groups.js index 1bf701d8..5740cbfd 100644 --- a/static/js/src/app/groups.js +++ b/static/js/src/app/groups.js @@ -56,8 +56,16 @@ function edit(id) { targets = $("#targetsTable").dataTable({ destroy: true, // Destroy any other instantiated table - http://datatables.net/manual/tech-notes/3#destroy columnDefs: [{ + targets: [0,1,2,3], + render: function ( data, type, row ) { + return type === 'display' && data.length > 15 ? + '' + data.substr(0,15) + '…': + '' + data + ''; + } + }, + { orderable: false, - targets: "no-sort" + targets: "no-sort", }] }) $("#modalSubmit").unbind('click').click(function () {