Commit 1fcc12cb authored by Camil Staps's avatar Camil Staps 🐧

Replace itasks-button-disabled class by disabled attribute

parent 063c7a9f
Pipeline #29245 passed with stage
in 4 minutes and 34 seconds
...@@ -39,13 +39,13 @@ ...@@ -39,13 +39,13 @@
width: 16px; width: 16px;
height: 16px; height: 16px;
} }
.#{$prefix}button-disabled { .#{$prefix}button:disabled {
color: lighten($button-text-color,35%); color: lighten($button-text-color,35%);
background: linear-gradient(lighten($button-base-color,20%), darken($button-base-color,20%)); background: linear-gradient(lighten($button-base-color,20%), darken($button-base-color,20%));
} }
.#{$prefix}button-disabled:hover { .#{$prefix}button:disabled:hover {
border-color: darken($button-base-color,40%); border-color: darken($button-base-color,40%);
} }
.#{$prefix}button-disabled .#{$prefix}button-icon { .#{$prefix}button:disabled .#{$prefix}button-icon {
opacity: 0.5; opacity: 0.5;
} }
...@@ -355,7 +355,7 @@ itasks.Button = { ...@@ -355,7 +355,7 @@ itasks.Button = {
el.appendChild(me.icon); el.appendChild(me.icon);
} }
if(!me.attributes.enabled) { if(!me.attributes.enabled) {
el.classList.add(me.cssPrefix + 'button-disabled'); el.disabled = true;
} }
if(me.attributes.text) { if(me.attributes.text) {
me.label = document.createElement('div'); me.label = document.createElement('div');
...@@ -387,11 +387,7 @@ itasks.Button = { ...@@ -387,11 +387,7 @@ itasks.Button = {
var me = this; var me = this;
switch(name) { switch(name) {
case 'enabled': case 'enabled':
if(value) { me.domEl.disabled = !value;
me.domEl.classList.remove(me.cssPrefix + 'button-disabled');
} else {
me.domEl.classList.add(me.cssPrefix + 'button-disabled');
}
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment