Can't stop to commit fixes, need to sleep. Last fix and last version for today.
This commit is contained in:
parent
5173c610e6
commit
ff9b79d956
2 changed files with 3 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ng2-fittext",
|
"name": "ng2-fittext",
|
||||||
"version": "1.0.20",
|
"version": "1.0.21",
|
||||||
"description": "An Angular2 directive for autoscale the font size of an element to fit an upper level container.",
|
"description": "An Angular2 directive for autoscale the font size of an element to fit an upper level container.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ export class Ng2FittextDirective implements AfterViewInit, OnInit {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if (this.useMaxFontSize) {
|
if (this.useMaxFontSize) {
|
||||||
this.maxFontSize = parseInt(window.getComputedStyle(this.el.nativeElement).fontSize, null);
|
this.maxFontSize = parseInt(window.getComputedStyle(this.container ? this.container : this.el.nativeElement.parentElement).fontSize, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.fittext) {
|
if (this.fittext) {
|
||||||
|
|
@ -77,7 +77,7 @@ export class Ng2FittextDirective implements AfterViewInit, OnInit {
|
||||||
} else {
|
} else {
|
||||||
if (this.useMaxFontSize) {
|
if (this.useMaxFontSize) {
|
||||||
if(this.fontSize > this.maxFontSize) {
|
if(this.fontSize > this.maxFontSize) {
|
||||||
this.maxFontSize = parseInt(window.getComputedStyle(this.el.nativeElement).fontSize, null);
|
this.maxFontSize = parseInt(window.getComputedStyle(this.container ? this.container : this.el.nativeElement.parentElement).fontSize, null);
|
||||||
this.setFontSize(this.maxFontSize);
|
this.setFontSize(this.maxFontSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue