Skip to content

Commit

Permalink
v0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fiznool committed Jan 11, 2017
1 parent 381cc41 commit b050032
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Thumbs.db
*.map
*.d.ts
*.ngfactory.ts
*.ngsummary.json
*.metadata.json
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

[0.12.0] - 2017-01-11
### Fixed
- Support latest Ionic nightly build.

[0.11.1] - 2016-11-11
### Fixed
- Export Elastic directive so that apps built with `ngc` work properly.
Expand All @@ -24,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Initial commit of elastic directive.

[0.12.0]: https://github.com/fiznool/angular2-elastic/compare/v0.11.1...v0.12.0
[0.11.1]: https://github.com/fiznool/angular2-elastic/compare/v0.11.0...v0.11.1
[0.11.0]: https://github.com/fiznool/angular2-elastic/compare/v0.10.1...v0.11.0
[0.10.1]: https://github.com/fiznool/angular2-elastic/compare/v0.10.0...v0.10.1
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular2-elastic",
"version": "0.11.1",
"version": "0.12.0",
"description": "Angular 2 directive to auto expand textareas according to their contents.",
"module": "index.js",
"main": "index.js",
Expand All @@ -27,11 +27,11 @@
"typings": "./index.d.ts",
"homepage": "https://github.com/fiznool/angular2-elastic#readme",
"devDependencies": {
"@angular/compiler": "2.1.2",
"@angular/compiler-cli": "2.1.2",
"@angular/core": "2.1.2",
"rxjs": "^5.0.0-beta.12",
"typescript": "2.0.9",
"zone.js": "0.6.26"
"@angular/compiler": "2.4.2",
"@angular/compiler-cli": "2.4.2",
"@angular/core": "2.4.2",
"rxjs": "5.0.3",
"typescript": "2.1.4",
"zone.js": "0.7.4"
}
}
12 changes: 4 additions & 8 deletions src/elastic.directive.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { ElementRef, HostListener, Directive} from '@angular/core';
import { ElementRef, HostListener, Directive, AfterViewInit, AfterViewChecked } from '@angular/core';
import { Observable } from 'rxjs/Rx';

interface CSSStyleDeclarationWithResize extends CSSStyleDeclaration {
resize: string
}

@Directive({
selector: '[fz-elastic]'
})
Expand All @@ -22,7 +18,7 @@ export class ElasticDirective {
setupTextarea(textareaEl: HTMLTextAreaElement) {
this.textareaEl = textareaEl;

const style: CSSStyleDeclarationWithResize = this.textareaEl.style as CSSStyleDeclarationWithResize;
const style = this.textareaEl.style;
style.overflow = 'hidden';
style.resize = 'none';

Expand All @@ -32,7 +28,7 @@ export class ElasticDirective {
.subscribe(() => this.adjust());
}

ngAfterContentInit() {
ngAfterViewInit() {
if(this.isTextarea(this.element.nativeElement)) {
this.setupTextarea(this.element.nativeElement);
return;
Expand All @@ -53,7 +49,7 @@ export class ElasticDirective {
this.adjust();
}

ngAfterContentChecked(): void {
ngAfterViewChecked(): void {
this.adjust();
}

Expand Down

0 comments on commit b050032

Please sign in to comment.