Skip to content

Commit 636c92a

Browse files
committed
work on redfine
1 parent a543b83 commit 636c92a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"description": "Base Custom Webcomponent",
33
"name": "@node-projects/base-custom-webcomponent",
4-
"version": "0.25.3",
4+
"version": "0.25.4",
55
"type": "module",
66
"main": "./dist/index.js",
77
"author": "",

src/DeclaritiveBaseCustomWebcomponent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,17 @@ class DeclaritiveBaseCustomWebcomponent extends BaseCustomWebComponentNoAttached
4949
}
5050
}
5151
const name = this.name;
52-
const definingElement = this;
53-
5452
if (window[name]) {
5553
window[name].template = undefined;
5654
//window[name].style = style;
5755
window[name].properties = props;
5856
window[name]._propertiesDictionary = null;
5957
window[name]._enableBindings = this.enableBindings;
58+
window[name]._definingElement = this;
6059
} else {
6160
window[name] = function () {
6261
if (window[name].template === undefined)
63-
window[name].template = definingElement.querySelector('template');
62+
window[name].template = window[name]._definingElement.querySelector('template');
6463
const instance = Reflect.construct(BaseDeclaritiveWebcomponent, [], window[name]);
6564

6665
for (let p in props) {
@@ -91,6 +90,7 @@ class DeclaritiveBaseCustomWebcomponent extends BaseCustomWebComponentNoAttached
9190
window[name].properties = props;
9291
window[name]._propertiesDictionary = null;
9392
window[name]._enableBindings = this.enableBindings;
93+
window[name]._definingElement = this;
9494
window[name].prototype = Object.create(BaseDeclaritiveWebcomponent.prototype, { constructor: { value: window[name] } })
9595
if (!customElements.get(name))
9696
customElements.define(name, window[name]);

0 commit comments

Comments
 (0)