From 5d5b05b387cf1361471c402dd42f56b8b908044f Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 14 Jan 2019 16:52:13 -0500 Subject: [PATCH] Fix an issue in new logger export feature Specifically, if selecting table+markdown, the export dialog would no longer be accessible once closed. --- src/js/logger-ui.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/js/logger-ui.js b/src/js/logger-ui.js index a7f068fff..24095a5a9 100644 --- a/src/js/logger-ui.js +++ b/src/js/logger-ui.js @@ -1503,7 +1503,11 @@ const reloadTab = function(ev) { // Rule if ( (text !== '') && - (trcl.contains('dynamicHost') || trcl.contains('dynamicUrl')) + ( + trcl.contains('dynamicHost') || + trcl.contains('dynamicUrl') || + trcl.contains('switch') + ) ) { rows[2].children[1].textContent = text; } else { @@ -2333,10 +2337,12 @@ const popupManager = (function() { } outputAll.push(outputOne.join('|')); } - outputAll.unshift( - `${' |'.repeat(fieldCount-1)} `, - `${':--- |'.repeat(fieldCount-1)}:--- ` - ); + if ( fieldCount !== 0 ) { + outputAll.unshift( + `${' |'.repeat(fieldCount-1)} `, + `${':--- |'.repeat(fieldCount-1)}:--- ` + ); + } return `
Logger output\n\n|${outputAll.join('|\n|')}|\n
\n`; }; @@ -2392,7 +2398,6 @@ const popupManager = (function() { ); } options[group] = value; - format(); }; const onOption = function(ev) { @@ -2421,6 +2426,7 @@ const popupManager = (function() { group.getAttribute('data-radio'), item.getAttribute('data-radio-item') ); + format(); ev.stopPropagation(); }; @@ -2432,18 +2438,19 @@ const popupManager = (function() { lines.length = 0; } ); + setRadioButton('format', options.format); setRadioButton('encoding', options.encoding); + collectLines(); + format(); + dialog.querySelector('.options').addEventListener( 'click', onOption, { capture: true } ); - collectLines(); - format(); - modalDialog.show(); };