Skip to content

Commit 21aeab8

Browse files
committed
refactor: rename internal variables
1 parent 9426214 commit 21aeab8

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎packages/dashboard/src/vaadin-dashboard.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ declare class Dashboard<TItem extends DashboardItem = DashboardItem> extends Das
128128

129129
/**
130130
* Custom function for rendering a widget for each dashboard item.
131-
* Placing something else than a widget in the cell is not supported.
131+
* Placing something else than a widget in the wrapper is not supported.
132132
* Receives three arguments:
133133
*
134134
* - `root` The container for the widget.

‎packages/dashboard/src/vaadin-dashboard.js‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Dashboard extends ControllerMixin(DashboardLayoutMixin(ElementMixin(Themab
7979

8080
/**
8181
* Custom function for rendering a widget for each dashboard item.
82-
* Placing something else than a widget in the cell is not supported.
82+
* Placing something else than a widget in the wrapper is not supported.
8383
* Receives three arguments:
8484
*
8585
* - `root` The container for the widget.
@@ -130,24 +130,24 @@ class Dashboard extends ControllerMixin(DashboardLayoutMixin(ElementMixin(Themab
130130
__itemsOrRendererChanged(items, renderer) {
131131
this.__renderItemWrappers(items || []);
132132

133-
this.querySelectorAll(WRAPPER_LOCAL_NAME).forEach((cell) => {
134-
if (cell.firstElementChild && cell.firstElementChild.localName === 'vaadin-dashboard-section') {
133+
this.querySelectorAll(WRAPPER_LOCAL_NAME).forEach((wrapper) => {
134+
if (wrapper.firstElementChild && wrapper.firstElementChild.localName === 'vaadin-dashboard-section') {
135135
return;
136136
}
137-
if (cell.__item.component instanceof HTMLElement) {
138-
if (cell.__item.component.parentElement !== cell) {
139-
cell.textContent = '';
140-
cell.appendChild(cell.__item.component);
137+
if (wrapper.__item.component instanceof HTMLElement) {
138+
if (wrapper.__item.component.parentElement !== wrapper) {
139+
wrapper.textContent = '';
140+
wrapper.appendChild(wrapper.__item.component);
141141
}
142142
} else if (renderer) {
143-
renderer(cell, this, { item: cell.__item });
143+
renderer(wrapper, this, { item: wrapper.__item });
144144
} else {
145-
cell.innerHTML = '';
145+
wrapper.innerHTML = '';
146146
}
147147

148-
if (cell.firstElementChild) {
148+
if (wrapper.firstElementChild) {
149149
SYNCHRONIZED_ATTRIBUTES.forEach((attr) => {
150-
cell.firstElementChild.toggleAttribute(attr, cell.hasAttribute(attr));
150+
wrapper.firstElementChild.toggleAttribute(attr, wrapper.hasAttribute(attr));
151151
});
152152
}
153153
});

0 commit comments

Comments
 (0)