From 132f55d83ed36c51bd1a24015af5bc5e965eb155 Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 14 Oct 2017 09:26:24 +0300 Subject: [PATCH] v4.0.2 --- CHANGELOG.md | 4 ++++ package.json | 2 +- .../share-buttons/share-buttons.component.ts | 2 +- src/directives/share-button.directive.ts | 11 +++++++---- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b3f1091..46bfec81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 4.0.2 + + - fix(switching button type) remove old button class + ## 4.0.1 - fix wrong rollup config for **HttpClientModule** diff --git a/package.json b/package.json index 8ce88e8f..dceeb035 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ngx-sharebuttons", "description": "Share buttons components for Angular 4.3+", - "version": "4.0.1", + "version": "4.0.2", "filename": "./src/ngx-sharebuttons.js", "homepage": "http://github.com/MurhafSousli/ngx-sharebuttons", "author": { diff --git a/src/components/share-buttons/share-buttons.component.ts b/src/components/share-buttons/share-buttons.component.ts index 37dd462a..99e02066 100644 --- a/src/components/share-buttons/share-buttons.component.ts +++ b/src/components/share-buttons/share-buttons.component.ts @@ -112,7 +112,7 @@ export class ShareButtonsComponent implements OnInit, OnDestroy { } /** Buttons theme */ - theme = this.share.theme; + theme; @Input('theme') set setTheme(theme: string) { diff --git a/src/directives/share-button.directive.ts b/src/directives/share-button.directive.ts index 8e4a500a..d069ca2d 100644 --- a/src/directives/share-button.directive.ts +++ b/src/directives/share-button.directive.ts @@ -57,6 +57,9 @@ export class ShareButtonDirective { /** Add new button class e.g.: sb-facebook, sb-twitter ...etc */ this.renderer.addClass(this.el, 'sb-' + button.prop.type); + /** Keep a copy of current class */ + this.buttonClass = button.prop.type; + /** Get link's shared count */ this.getCount(); } else { @@ -88,10 +91,10 @@ export class ShareButtonDirective { @Output() sbClosed = new EventEmitter(); constructor(private share: ShareButtonsService, - public renderer: Renderer2, - public cd: ChangeDetectorRef, - el: ElementRef, - universal: UniversalSupportService) { + public renderer: Renderer2, + public cd: ChangeDetectorRef, + el: ElementRef, + universal: UniversalSupportService) { this.el = el.nativeElement; this.window = universal.nativeWindow; }