From 6d7f8cf1860bd922b1c0e2ecf8996a0b2faddc36 Mon Sep 17 00:00:00 2001 From: AleBles Date: Wed, 18 Dec 2019 10:58:17 +0100 Subject: [PATCH] Interpunction and ie edge banner fix --- CHANGELOG.md | 1 + package-lock.json | 92 ++++++++++++++++++------------- package.json | 8 +-- src/Providers/gamedistribution.ts | 11 +++- 4 files changed, 67 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d43f6af..a8d7ce0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.4.5] - 2019-12-17 ## Fixed - Disallowed double calling of alignIn for GD banner +- Check for parent div on banner resize ## [0.4.4] - 2019-12-02 diff --git a/package-lock.json b/package-lock.json index e64c2e1..b7bd98f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@azerion/h5-ad-wrapper", - "version": "0.4.4", + "version": "0.4.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -869,9 +869,9 @@ "dev": true }, "@types/node": { - "version": "10.17.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz", - "integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA==", + "version": "10.17.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.11.tgz", + "integrity": "sha512-dNd2pp8qTzzNLAs3O8nH3iU9DG9866KHq9L3ISPB7DOGERZN81nW/5/g/KzMJpCU8jrbCiMRBzV9/sCEdRosig==", "dev": true }, "@types/semver": { @@ -1996,17 +1996,16 @@ } }, "coveralls": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.7.tgz", - "integrity": "sha512-mUuH2MFOYB2oBaA4D4Ykqi9LaEYpMMlsiOMJOrv358yAjP6enPIk55fod2fNJ8AvwoYXStWQls37rA+s5e7boA==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.9.tgz", + "integrity": "sha512-nNBg3B1+4iDox5A5zqHKzUTiwl2ey4k2o0NEcVZYvl+GOSJdKBj4AJGKLv6h3SvWch7tABHePAQOSZWM9E2hMg==", "dev": true, "requires": { - "growl": "~> 1.10.0", "js-yaml": "^3.13.1", - "lcov-parse": "^0.0.10", + "lcov-parse": "^1.0.0", "log-driver": "^1.2.7", "minimist": "^1.2.0", - "request": "^2.86.0" + "request": "^2.88.0" } }, "cross-env": { @@ -3544,12 +3543,6 @@ "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -3663,10 +3656,33 @@ } }, "highlight.js": { - "version": "9.16.2", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.16.2.tgz", - "integrity": "sha512-feMUrVLZvjy0oC7FVJQcSQRqbBq9kwqnYE4+Kj9ZjbHh3g+BisiPgF49NyQbVLNdrL/qqZr3Ca9yOKwgn2i/tw==", - "dev": true + "version": "9.17.1", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.17.1.tgz", + "integrity": "sha512-TA2/doAur5Ol8+iM3Ov7qy3jYcr/QiJ2eDTdRF4dfbjG7AaaB99J5G+zSl11ljbl6cIcahgPY6SKb3sC3EJ0fw==", + "dev": true, + "requires": { + "handlebars": "^4.5.3" + }, + "dependencies": { + "handlebars": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", + "dev": true, + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } }, "homedir-polyfill": { "version": "1.0.3", @@ -4973,9 +4989,9 @@ } }, "lcov-parse": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", - "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", + "integrity": "sha1-6w1GtUER68VhrLTECO+TY73I9+A=", "dev": true }, "left-pad": { @@ -7841,21 +7857,21 @@ } }, "typedoc": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.15.2.tgz", - "integrity": "sha512-K2nFEtyDQTVdXOzYtECw3TwuT3lM91Zc0dzGSLuor5R8qzZbwqBoCw7xYGVBow6+mEZAvKGznLFsl7FzG+wAgQ==", + "version": "0.15.5", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.15.5.tgz", + "integrity": "sha512-AKXLtOUCLRlSTyfXQHYp3LFPy6RiFLnxnKS5z1jwQsYXmCPbHWuhmfgS264Es2hPMZjzvHqk/ZQDzCBpb49u6w==", "dev": true, "requires": { "@types/minimatch": "3.0.3", "fs-extra": "^8.1.0", - "handlebars": "^4.5.1", - "highlight.js": "^9.16.2", + "handlebars": "^4.5.3", + "highlight.js": "^9.17.1", "lodash": "^4.17.15", "marked": "^0.7.0", "minimatch": "^3.0.0", "progress": "^2.0.3", "shelljs": "^0.8.3", - "typedoc-default-themes": "^0.6.1", + "typedoc-default-themes": "^0.6.2", "typescript": "3.7.x" }, "dependencies": { @@ -7877,9 +7893,9 @@ "dev": true }, "handlebars": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.2.tgz", - "integrity": "sha512-29Zxv/cynYB7mkT1rVWQnV7mGX6v7H/miQ6dbEpYTKq5eJBN7PsRB+ViYJlcT6JINTSu4dVB9kOqEun78h6Exg==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -7897,9 +7913,9 @@ } }, "typedoc-default-themes": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.6.1.tgz", - "integrity": "sha512-z5AWKqQDz7igl9WkUuafx8cEm4MPVQGMpbWE+3lwVOaq+U4UoLKBMnpFQWh/4fqQ3bGysXpOstMxy2OOzHezyw==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.6.2.tgz", + "integrity": "sha512-+O+1aHjVIpDLsbkIDkZSNu+kutqmg7WdzahT+4KwBC/95mUgAb0xkbwdPpEJEpRX0ov1UJoCmvEPb1/VHxnTuw==", "dev": true, "requires": { "backbone": "^1.4.0", @@ -7909,9 +7925,9 @@ } }, "typescript": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz", - "integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==", + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz", + "integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 8a9d8e9..86d77dd 100644 --- a/package.json +++ b/package.json @@ -96,10 +96,10 @@ "@commitlint/cli": "^8.2.0", "@commitlint/config-conventional": "^7.6.0", "@types/jest": "^23.3.2", - "@types/node": "^10.17.5", + "@types/node": "^10.17.11", "colors": "^1.4.0", "commitizen": "^4.0.3", - "coveralls": "^3.0.7", + "coveralls": "^3.0.9", "cross-env": "^5.2.1", "cz-conventional-changelog": "^2.1.0", "husky": "^1.0.1", @@ -125,8 +125,8 @@ "tslint": "^5.20.1", "tslint-config-prettier": "^1.15.0", "tslint-config-standard": "^8.0.1", - "typedoc": "^0.15.2", - "typescript": "^3.7.2" + "typedoc": "^0.15.5", + "typescript": "^3.7.3" }, "dependencies": { "eventemitter3": "^3.1.2" diff --git a/src/Providers/gamedistribution.ts b/src/Providers/gamedistribution.ts index a6370dd..821390d 100644 --- a/src/Providers/gamedistribution.ts +++ b/src/Providers/gamedistribution.ts @@ -68,13 +68,14 @@ export class GameDistributionBanner { public destroy(): void { document.body.removeChild(this.element) - delete this.element - delete this.parent - delete this.alignment if (this.resizeListener) { window.removeEventListener('resize', this.resizeListener) } + + delete this.element + delete this.parent + delete this.alignment } public alignIn(element: HTMLElement, position: GameDistributionAlignment): void { @@ -99,6 +100,10 @@ export class GameDistributionBanner { } private resize(): void { + if (!this.parent) { + return + } + const parentBoundingRect: ClientRect = this.parent.getBoundingClientRect() switch (this.alignment) {