Skip to content

Commit e864b26

Browse files
chore: trial panel button refactoring (#27361)
Co-authored-by: Vasily Strelyaev <VasilyStrelyaev@users.noreply.github.com>
1 parent 0e554e5 commit e864b26

1 file changed

Lines changed: 26 additions & 16 deletions

File tree

packages/devextreme/js/__internal/core/license/trial_panel.ts

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const contentStyles = {
3333
...commonStyles,
3434
width: '100%',
3535
height: 'auto',
36-
'line-height': 'auto',
36+
'line-height': 'normal',
3737
display: 'block',
3838
'z-index': `${BASE_Z_INDEX}`,
3939
position: 'static',
@@ -142,23 +142,33 @@ class DxLicense extends HTMLElement {
142142
private _createButton(): HTMLDivElement {
143143
const button = document.createElement('div');
144144
button.style.cssText = this._buttonStyles;
145-
button.innerHTML = `<?xml version="1.0" encoding="UTF-8"?>
146-
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 16">
147-
<polygon points="13.4 12.7 8.7 8 13.4 3.4 12.6 2.6 8 7.3 3.4 2.6 2.6 3.4 7.3 8 2.6 12.6 3.4 13.4 8 8.7 12.7 13.4 13.4 12.7"/>
148-
</svg>`;
149-
const polygon = button.querySelector('polygon');
150-
const svg = button.querySelector('svg');
151-
if (svg) {
152-
svg.style.verticalAlign = 'baseline';
153-
}
154-
if (polygon) {
155-
polygon.style.fill = '#fff';
156-
polygon.style.opacity = '.5';
157-
polygon.style.strokeWidth = '0px';
158-
}
145+
146+
const polygon = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');
147+
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
148+
149+
polygon.setAttribute('points', '13.4 12.7 8.7 8 13.4 3.4 12.6 2.6 8 7.3 3.4 2.6 2.6 3.4 7.3 8 2.6 12.6 3.4 13.4 8 8.7 12.7 13.4 13.4 12.7');
150+
polygon.style.cssText = this._createImportantStyles({
151+
fill: '#fff',
152+
opacity: '.5',
153+
'stroke-width': '0px',
154+
});
155+
156+
svg.setAttribute('id', 'Layer_1');
157+
svg.setAttribute('data-name', 'Layer 1');
158+
svg.setAttribute('version', '1.1');
159+
svg.setAttribute('viewBox', '0 0 16 16');
160+
svg.style.cssText = this._createImportantStyles({
161+
'vertical-align': 'baseline',
162+
});
163+
164+
svg.appendChild(polygon);
165+
button.appendChild(svg);
166+
159167
button.onclick = (): void => {
160168
this._hidden = true;
161-
this.style.display = 'none';
169+
this.style.cssText = this._createImportantStyles({
170+
display: 'none',
171+
});
162172
};
163173
return button;
164174
}

0 commit comments

Comments
 (0)