chore: Usa l'API nativa di JS
This commit is contained in:
parent
7993648b28
commit
12359d1fba
|
@ -416,7 +416,7 @@
|
|||
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="19">
|
||||
<list size="20">
|
||||
<item index="0" class="java.lang.String" itemvalue="nobr" />
|
||||
<item index="1" class="java.lang.String" itemvalue="noembed" />
|
||||
<item index="2" class="java.lang.String" itemvalue="comment" />
|
||||
|
@ -436,6 +436,7 @@
|
|||
<item index="16" class="java.lang.String" itemvalue="text-field" />
|
||||
<item index="17" class="java.lang.String" itemvalue="text-area" />
|
||||
<item index="18" class="java.lang.String" itemvalue="icon-button" />
|
||||
<item index="19" class="java.lang.String" itemvalue="mwc-circular-progress" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
|
|
|
@ -2,6 +2,7 @@ import '@material/mwc-circular-progress';
|
|||
import '@material/mwc-button';
|
||||
|
||||
import type {Button} from '@material/mwc-button';
|
||||
import type {CircularProgress} from '@material/mwc-circular-progress';
|
||||
import type CSS from 'csstype';
|
||||
import type {VnodeDOM} from 'mithril';
|
||||
|
||||
|
@ -13,14 +14,6 @@ type Attributes = Partial<Button> & {
|
|||
icon?: string
|
||||
};
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
LoadingButton: LoadingButton
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class LoadingButton extends Component<Attributes> {
|
||||
view() {
|
||||
return ( // @ts-ignore
|
||||
|
@ -60,7 +53,8 @@ class LoadingButton extends Component<Attributes> {
|
|||
|
||||
oncreate(vnode: VnodeDOM<Attributes>) {
|
||||
super.oncreate(vnode);
|
||||
$(this.element).find('mwc-circular-progress').attr('density', String(-7));
|
||||
this.element.querySelector<CircularProgress>('mwc-circular-progress')
|
||||
?.setAttribute('density', '-7');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue