From 6755ebcbf8f3f8f5f9058d19ed1efae7a899e50b Mon Sep 17 00:00:00 2001 From: zmagod Date: Thu, 15 Dec 2016 15:26:51 +0100 Subject: [PATCH] fixes bug with long column names in edit mode [fixes SCI-803] --- .../javascripts/samples/sample_datatable.js.erb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/samples/sample_datatable.js.erb b/app/assets/javascripts/samples/sample_datatable.js.erb index 445e778aa..8f496ed2d 100644 --- a/app/assets/javascripts/samples/sample_datatable.js.erb +++ b/app/assets/javascripts/samples/sample_datatable.js.erb @@ -936,6 +936,14 @@ function changeToEditMode() { var visLi = (visible) ? '' : 'col-invisible'; var editClass = (editable) ? '' : 'disabled'; var delClass = (deletable) ? '' : 'disabled'; + + var thederName; + if ($(el).find('.modal-tooltiptext').length > 0) { + thederName = $(el).find('.modal-tooltiptext').text(); + } else { + thederName = el.innerText; + } + var html = '
  • ' + ' ' + - '' + generateColumnNameTooltip(el.innerText) + ' ' + + '' + generateColumnNameTooltip(thederName) + ' ' + '' + '' + '' + @@ -1075,6 +1083,9 @@ function changeToEditMode() { var self = $(this); var li = self.closest('li'); var text = li.find('.text'); + if ($(text).find('.modal-tooltiptext').length > 0) { + text = $(text).find('.modal-tooltiptext'); + } var textEdit = li.find('.text-edit'); var controls = li.find('.controls .vis,.edit,.del'); var controlsEdit = li.find('.controls .ok,.cancel');