Feature/#48 migrate to typescript #151

Merged
Serraniel merged 30 commits from feature/#48-migrate-to-typescript into develop 2020-12-30 17:24:49 +01:00
Showing only changes of commit 8a0f4a3db2 - Show all commits

View file

@ -2,13 +2,12 @@ import { getGlobalConfiguration, SETTINGS_websiteHideUnusedTabs, SETTINGS_websit
import * as core from '../utils/aniwatchCore';
import * as helper from '../utils/helpers';
export function init() {
export function init(): void {
getGlobalConfiguration().getProperty(SETTINGS_websiteHideUnusedTabs, value => {
// if disabled, add class to avoid our css optimizations
if (!value) {
let disableFunc = node => {
if (helper.isHtmlElement(node)) {
let disableNode = node => {
let disableFunc = (node: Element) => {
let disableNode = (node: Element) => {
node.classList.add('awp-hide-unused-disabled')
}
@ -18,11 +17,12 @@ export function init() {
else {
node.querySelectorAll('md-tab-item').forEach(node => disableNode(node));
}
}
};
core.registerScript(node => {
if (node instanceof Element) {
disableFunc(node);
}
}, ".*");
core.runAfterLoad(() => {
@ -34,9 +34,8 @@ export function init() {
getGlobalConfiguration().getProperty(SETTINGS_websiteOptimizeListAppearance, value => {
// if disabled, add class to avoid our css optimizations
if (!value) {
let disableFunc = node => {
if (helper.isHtmlElement(node)) {
let disableNode = node => {
let disableFunc = (node: Element) => {
let disableNode = (node: Element) => {
node.classList.add('awp-list-disabled')
}
@ -47,10 +46,11 @@ export function init() {
node.querySelectorAll('md-list-item').forEach(node => disableNode(node));
}
}
}
core.registerScript(node => {
if (node instanceof Element) {
disableFunc(node);
}
}, ".*");
core.runAfterLoad(() => {