Skip to content

Commit

Permalink
fix(editors/template): create element with NS definition (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobVogelsang authored Feb 27, 2022
1 parent d24537b commit 6fe49d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/editors/templates/datype-wizards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { SingleSelectedEvent } from '@material/mwc-list/mwc-list-foundation';
import '../../wizard-textfield.js';
import {
Create,
createElement,
EditorAction,
getValue,
identity,
Expand Down Expand Up @@ -153,7 +154,7 @@ function addPredefinedDAType(
: null;
const element = values.selected
? <Element>selectedElement!.cloneNode(true)
: parent.ownerDocument.createElement('DAType');
: createElement(parent.ownerDocument, 'DAType', {});

element.setAttribute('id', id);
if (desc) element.setAttribute('desc', desc);
Expand Down
2 changes: 1 addition & 1 deletion src/editors/templates/enumtype-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function createAction(parent: Element, templates: XMLDocument): WizardActor {
.querySelector(`EnumType[id="${values.selected.value}"]`)!
.cloneNode(true)
)
: parent.ownerDocument.createElement('EnumType');
: createElement(parent.ownerDocument, 'EnumType', {});

element.setAttribute('id', id);
if (desc) element.setAttribute('desc', desc);
Expand Down

0 comments on commit 6fe49d2

Please sign in to comment.