#631 image path update in all web components

This commit is contained in:
agriyadev5
2021-09-20 14:35:01 +05:30
parent 7da44c5d8a
commit ff91754c9f
22 changed files with 90 additions and 95 deletions

View File

@@ -83,7 +83,7 @@ export class ToolButton extends HTMLElement {
this.$div.style = newValue;
break;
case 'src':
this.$img.setAttribute('src', newValue);
this.$img.setAttribute('src', (newValue.indexOf("data:") === -1) ? './images/' + newValue : newValue);
break;
case 'pressed':
if (newValue === null) {

View File

@@ -694,7 +694,7 @@ export class SeColorPicker extends HTMLElement {
if (oldValue === newValue) return;
switch (name) {
case 'src':
this.$logo.setAttribute('src', newValue);
this.$logo.setAttribute('src', './images/' + newValue);
break;
case 'label':
this.setAttribute('title', t(newValue));

View File

@@ -172,7 +172,7 @@ export class ExplorerButton extends HTMLElement {
}
break;
case 'src':
this.$img.setAttribute('src', newValue);
this.$img.setAttribute('src', './images/' + newValue);
break;
default:
// eslint-disable-next-line no-console

View File

@@ -235,7 +235,7 @@ export class FlyingButton extends HTMLElement {
connectedCallback () {
// initialize currentAction with the first slot of the list
this.activeSlot = this.shadowRoot.querySelector('slot').assignedElements()[0];
this.$img.setAttribute('src', this.activeSlot.getAttribute('src'));
this.$img.setAttribute('src', './images/' + this.activeSlot.getAttribute('src'));
// capture click event on the button to manage the logic
const onClickHandler = (ev) => {
ev.stopPropagation();
@@ -251,7 +251,7 @@ export class FlyingButton extends HTMLElement {
break;
case 'SE-BUTTON':
// change to the current action
this.$img.setAttribute('src', ev.target.getAttribute('src'));
this.$img.setAttribute('src', './images/' + ev.target.getAttribute('src'));
this.activeSlot = ev.target;
this.setAttribute('pressed', 'pressed');
// and close the menu

View File

@@ -64,7 +64,7 @@ export class SeMenu extends HTMLElement {
if (oldValue === newValue) return;
switch (name) {
case 'src':
image.src = newValue;
image.src = './images/' + newValue;
image.width = 24;
image.height = 24;
this.$label.prepend(image);

View File

@@ -49,7 +49,7 @@ export class SeMenuItem extends HTMLElement {
if (oldValue === newValue) return;
switch (name) {
case 'src':
this.$img.setAttribute('src', newValue);
this.$img.setAttribute('src', './images/'+newValue);
this.$img.style.display = 'inline-block';
break;
case 'label':

View File

@@ -92,7 +92,7 @@ export class SESpinInput extends HTMLElement {
}
break;
case 'src':
this.$img.setAttribute('src', newValue);
this.$img.setAttribute('src', './images/' + newValue);
this.$label.remove();
this.$div.classList.add('imginside');
break;

View File

@@ -80,7 +80,7 @@ class Zoom extends ListComboBox {
// this.$span.setAttribute('title', `${newValue} ${shortcut ? `[${shortcut}]` : ''}`);
break;
case 'src':
this.src = newValue;
this.src = './images/' + newValue;
break;
case 'inputsize':
this.inputsize = newValue;