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