in progress

This commit is contained in:
jfh
2020-10-31 22:42:39 +01:00
parent a6479913ea
commit ff79759922
13 changed files with 380 additions and 190 deletions

View File

@@ -4,7 +4,7 @@
const template = document.createElement('template');
template.innerHTML = `
<style>
:host :hover :not(.disabled)
:host(:hover) :not(.disabled)
{
background-color: #ffc;
}
@@ -32,7 +32,7 @@ template.innerHTML = `
height: 100%;
}
.pressed {
background-color: #F4E284 !important;
background-color: #F4E284;
box-shadow: inset 1px 1px 2px rgba(0,0,0,0.4), 1px 1px 0 white !important;
}
.disabled {
@@ -65,7 +65,7 @@ export class ToolButton extends HTMLElement {
* @returns {any} observed
*/
static get observedAttributes () {
return ['title', 'src', 'pressed', 'disabled', 'size'];
return ['title', 'src', 'pressed', 'disabled', 'size', 'style'];
}
/**
* @function attributeChangedCallback
@@ -83,6 +83,9 @@ export class ToolButton extends HTMLElement {
this.$div.setAttribute('title', `${newValue} ${shortcut ? `[${shortcut}]` : ''}`);
}
break;
case 'style':
this.$div.style = newValue;
break;
case 'src':
this.$img.setAttribute('src', newValue);
break;