diff --git a/src/settings/settings.ts b/src/settings/settings.ts index 02687a43..fa5690e9 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -1,7 +1,6 @@ import {UIPBoolSetting} from './setting/bool-setting/bool-setting'; import {UIPSelectSetting} from './setting/select-setting/select-setting'; import {UIPTextSetting} from './setting/text-setting/text-setting'; -import {UIPClassSetting} from './setting/class-setting/class-setting'; import {UIPSetting} from './setting/setting'; import {bind} from '@exadel/esl/modules/esl-utils/decorators/bind'; import {ESLBaseElement, attr} from '@exadel/esl/modules/esl-base-element/core'; @@ -83,10 +82,6 @@ export class UIPSettings extends ESLBaseElement { ]; } - protected get classSettingsTags(): any[] { - return [...this.getElementsByTagName(UIPClassSetting.is)]; - } - @bind public parseCode(e: CustomEvent): void { const {markup, source} = e.detail; @@ -99,8 +94,6 @@ export class UIPSettings extends ESLBaseElement { const component = new DOMParser().parseFromString(markup, 'text/html').body; this.setAttrSettings(component); - this.setClassSettings(component); - } protected renderWrapper(markup: string) { @@ -134,25 +127,5 @@ export class UIPSettings extends ESLBaseElement { } } } - - protected setClassSettings(component: HTMLElement): void { - for (let classSetting of this.classSettingsTags) { - classSetting = classSetting as UIPClassSetting; - const {selector, values} = classSetting; - - const classLists: DOMTokenList[] = Array.prototype.map.call(component.querySelectorAll(selector), - (tag: HTMLElement) => tag.classList); - if (!classLists.length) continue; - - const item = values.find((val: string) => classLists[0].contains(val)); - - if (classLists.length === 1) { - item ? (classSetting.value = item) : (classSetting.value = 'null'); - } else { - classLists.every((classList: DOMTokenList) => classList.contains(item)) ? - classSetting.value = item : classSetting.value = 'null'; - } - } - } }