Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
782c9cd740 | |||
b8ab19a683 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/websetup",
|
"name": "@pushrocks/websetup",
|
||||||
"version": "3.0.6",
|
"version": "3.0.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/websetup",
|
"name": "@pushrocks/websetup",
|
||||||
"version": "3.0.6",
|
"version": "3.0.7",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "setup basic page properties",
|
"description": "setup basic page properties",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -6,6 +6,8 @@ import * as plugins from './websetup.plugins';
|
|||||||
|
|
||||||
export type TBaseLevelType = 'global' | 'base' | 'subpage';
|
export type TBaseLevelType = 'global' | 'base' | 'subpage';
|
||||||
|
|
||||||
|
export type TLevelState = 'enabled' | 'disabled';
|
||||||
|
|
||||||
export class TagLevel {
|
export class TagLevel {
|
||||||
public tagManagerRef: TagManager;
|
public tagManagerRef: TagManager;
|
||||||
|
|
||||||
@ -13,12 +15,17 @@ export class TagLevel {
|
|||||||
public type: TBaseLevelType;
|
public type: TBaseLevelType;
|
||||||
public tags: Tag[] = [];
|
public tags: Tag[] = [];
|
||||||
|
|
||||||
|
public state: TLevelState = 'disabled';
|
||||||
|
|
||||||
constructor(tagManagerRefArg: TagManager, levelType: TBaseLevelType) {
|
constructor(tagManagerRefArg: TagManager, levelType: TBaseLevelType) {
|
||||||
this.tagManagerRef = tagManagerRefArg;
|
this.tagManagerRef = tagManagerRefArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public addTag(tagArg: Tag) {
|
public addTag(tagArg: Tag) {
|
||||||
this.tags.push(tagArg);
|
this.tags.push(tagArg);
|
||||||
|
if (this.state === 'enabled') {
|
||||||
|
tagArg.appendToDom();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async addCompanyInfo(companyDataArg: plugins.tsclass.business.ICompany) {
|
public async addCompanyInfo(companyDataArg: plugins.tsclass.business.ICompany) {
|
||||||
@ -63,11 +70,13 @@ export class TagLevel {
|
|||||||
for (const tagArg of this.tags) {
|
for (const tagArg of this.tags) {
|
||||||
tagArg.appendToDom();
|
tagArg.appendToDom();
|
||||||
}
|
}
|
||||||
|
this.state = 'enabled';
|
||||||
}
|
}
|
||||||
|
|
||||||
public async disable() {
|
public async disable() {
|
||||||
for (const tagArg of this.tags) {
|
for (const tagArg of this.tags) {
|
||||||
tagArg.removeFromDom();
|
tagArg.removeFromDom();
|
||||||
}
|
}
|
||||||
|
this.state = 'disabled';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user