Skip to content

Commit 6fe49d2

Browse files
fix(editors/template): create element with NS definition (openscd#567)
1 parent d24537b commit 6fe49d2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/editors/templates/datype-wizards.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { SingleSelectedEvent } from '@material/mwc-list/mwc-list-foundation';
1313
import '../../wizard-textfield.js';
1414
import {
1515
Create,
16+
createElement,
1617
EditorAction,
1718
getValue,
1819
identity,
@@ -153,7 +154,7 @@ function addPredefinedDAType(
153154
: null;
154155
const element = values.selected
155156
? <Element>selectedElement!.cloneNode(true)
156-
: parent.ownerDocument.createElement('DAType');
157+
: createElement(parent.ownerDocument, 'DAType', {});
157158

158159
element.setAttribute('id', id);
159160
if (desc) element.setAttribute('desc', desc);

src/editors/templates/enumtype-wizard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function createAction(parent: Element, templates: XMLDocument): WizardActor {
189189
.querySelector(`EnumType[id="${values.selected.value}"]`)!
190190
.cloneNode(true)
191191
)
192-
: parent.ownerDocument.createElement('EnumType');
192+
: createElement(parent.ownerDocument, 'EnumType', {});
193193

194194
element.setAttribute('id', id);
195195
if (desc) element.setAttribute('desc', desc);

0 commit comments

Comments
 (0)