plugin updates
This commit is contained in:
@@ -65,6 +65,8 @@
|
||||
if ( ! allow ) {
|
||||
// Reset cookies, and clear form data.
|
||||
removeTrackingCookies();
|
||||
} else if ( typeof sbjs === 'undefined' ) {
|
||||
return; // Do nothing, as sourcebuster.js is not loaded.
|
||||
} else {
|
||||
// If not done yet, initialize sourcebuster.js which populates `sbjs.get` object.
|
||||
sbjs.init( {
|
||||
@@ -153,12 +155,16 @@
|
||||
* but it's not yet supported in Safari.
|
||||
*/
|
||||
connectedCallback() {
|
||||
let inputs = '';
|
||||
this.innerHTML = '';
|
||||
const inputs = new DocumentFragment();
|
||||
for( const fieldName of this._fieldNames ) {
|
||||
const value = stringifyFalsyInputValue( this.values[ fieldName ] );
|
||||
inputs += `<input type="hidden" name="${params.prefix}${fieldName}" value="${value}"/>`;
|
||||
const input = document.createElement( 'input' );
|
||||
input.type = 'hidden';
|
||||
input.name = `${params.prefix}${fieldName}`;
|
||||
input.value = stringifyFalsyInputValue( ( this.values && this.values[ fieldName ] ) || '' );
|
||||
inputs.appendChild( input );
|
||||
}
|
||||
this.innerHTML = inputs;
|
||||
this.appendChild( inputs );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user