CustomTabularExporterDialog: fix checkbox options being ignored (#2429)

Any value (even an empty string) of the checked attribute will be threated as checked. Fixed by passing null to jQuerys attr function which removes the attribute.
https://stackoverflow.com/questions/4228658/what-values-for-checked-and-selected-are-false
This commit is contained in:
Albin Larsson 2020-03-18 05:54:04 +01:00 committed by GitHub
parent 0233e7186b
commit 1bbf3df0f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,11 +255,9 @@ CustomTabularExporterDialog.prototype._configureUIFromOptionCode = function(opti
this._elmts.separatorInput[0].value = escapeJavascriptString(options.separator || ',');
this._elmts.lineSeparatorInput[0].value = escapeJavascriptString(options.lineSeparator || '\n');
this._elmts.encodingInput[0].value = options.encoding;
this._elmts.outputColumnHeadersCheckbox.attr('checked', (options.outputColumnHeaders) ? 'checked' : '');
this._elmts.outputEmptyRowsCheckbox.attr('checked', (options.outputBlankRows) ? 'checked' : '');
if (options.quoteAll) {
this._elmts.quoteAllCheckbox.attr('checked');
}
this._elmts.outputColumnHeadersCheckbox.attr('checked', (options.outputColumnHeaders) ? 'checked' : null);
this._elmts.outputEmptyRowsCheckbox.attr('checked', (options.outputBlankRows) ? 'checked' : null);
this._elmts.quoteAllCheckbox.attr('checked', (options.quoteAll) ? 'checked' : null);
if (options.columns !== null) {
var self = this;