fix: draw main put button text to svg

This commit is contained in:
Michal Szczepanski 2023-09-14 03:24:03 +02:00
parent 183a58e856
commit 111eb5aef1
4 changed files with 37 additions and 27 deletions

@ -203,8 +203,8 @@ export class DrawBarComponent implements HtmlComponent<HTMLElement>, HtmlCompone
// this.placeComponent(this.drawTest.render(), 220);
this.placeComponent(this.drawSave.render(), this.model.rect.width - 56);
this.placeComponent(this.drawCancel.render(), this.model.rect.width - 28);
this.placeComponent(this.drawSave.render(), 222);
this.placeComponent(this.drawCancel.render(), 244);
this.adjustTop();

@ -26,16 +26,18 @@ export class DrawEditButton implements HtmlComponent<HTMLElement> {
}
render(): HTMLElement {
this.el.innerText = 'Edit';
this.el.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62 20">
<style>.ft {
color: #000;
font-size: 1em;
font-weight: normal;
margin-left: 10px;
line-height: 1.5;
font-family: Roboto, sans-serif;
}</style>
<text x="5" y="17" class="ft">Edit</text>
</svg>`;
this.el.addEventListener('click', this.handleClick);
applyStylesToElement(this.el, {
cursor: 'pointer',
color: '#000',
'font-size': '1em',
'font-weight': 'bold',
'margin-left': '10px'
});
return this.el;
}

@ -26,16 +26,20 @@ export class DrawNewCancelButton implements HtmlComponent<HTMLElement> {
}
render(): HTMLElement {
this.el.innerText = 'Cancel';
this.el.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62 20">
<style>.ft {
color: #000;
font-size: 1em;
font-weight: normal;
margin-left: 10px;
line-height: 1.5;
font-family: Roboto, sans-serif;
}</style>
<text x="5" y="17" class="ft">Cancel</text>
</svg>`;
this.el.addEventListener('click', this.handleClick);
applyStylesToElement(this.el, {
cursor: 'pointer',
color: '#000',
'font-size': '1em',
'font-weight': 'bold',
'margin-left': '10px'
});
applyStylesToElement(this.el, { cursor: 'pointer', width: '62px' });
return this.el;
}

@ -26,16 +26,20 @@ export class DrawNewButton implements HtmlComponent<HTMLElement> {
}
render(): HTMLElement {
this.el.innerText = 'New';
this.el.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 20">
<style>.ft {
color: #000;
font-size: 1em;
font-weight: normal;
margin-left: 10px;
line-height: 1.5;
font-family: Roboto, sans-serif;
}</style>
<text x="5" y="17" class="ft">New</text>
</svg>`;
this.el.addEventListener('click', this.handleClick);
applyStylesToElement(this.el, {
cursor: 'pointer',
color: '#000',
'font-size': '1em',
'font-weight': 'bold',
'margin-left': '10px'
});
applyStylesToElement(this.el, { cursor: 'pointer', width: '40px' });
return this.el;
}