[BUGFIX] clone node form element
This commit is contained in:
parent
3b04cdc5ca
commit
0c25f37a2f
@ -65,7 +65,8 @@ function initSidebar() {
|
|||||||
function initTripSidebar(triggerElement: HTMLElement) {
|
function initTripSidebar(triggerElement: HTMLElement) {
|
||||||
const sidebarElement = <HTMLElement>document.querySelector('#addTrip');
|
const sidebarElement = <HTMLElement>document.querySelector('#addTrip');
|
||||||
if(sidebarElement && triggerElement.dataset.form && triggerElement.dataset.header) {
|
if(sidebarElement && triggerElement.dataset.form && triggerElement.dataset.header) {
|
||||||
let formElement = <HTMLElement>document.querySelector(triggerElement.dataset.form);
|
let form = <HTMLElement>document.querySelector(triggerElement.dataset.form);
|
||||||
|
let formElement = <HTMLElement>form.cloneNode(true);
|
||||||
let formContainerElement = <HTMLElement>sidebarElement.querySelector('.form-js');
|
let formContainerElement = <HTMLElement>sidebarElement.querySelector('.form-js');
|
||||||
if(formContainerElement) {
|
if(formContainerElement) {
|
||||||
formContainerElement.innerHTML = '';
|
formContainerElement.innerHTML = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user