luci-base: cbi.js: avoid setting empty cell title attributes
authorJo-Philipp Wich <jo@mein.io>
Mon, 9 Jul 2018 09:09:57 +0000 (11:09 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 9 Jul 2018 09:51:43 +0000 (11:51 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js

index 74b275742c637d7394e5c433244ecce46c5e85ce..ddbff834182210021a5a8ee47e2dd4d036a6e924 100644 (file)
@@ -2081,10 +2081,10 @@ function cbi_update_table(table, data, placeholder) {
                                var trow = E('div', { 'class': 'tr' });
 
                                for (var i = 0; i < titles.length; i++) {
-                                       var text = titles[i].innerText;
+                                       var text = (titles[i].innerText || '').trim();
                                        var td = trow.appendChild(E('div', {
                                                'class': titles[i].className,
-                                               'data-title': text ? text.trim() : null
+                                               'data-title': (text !== '') ? text : null
                                        }, row[i] || ''));
 
                                        td.classList.remove('th');