Skip to content

Commit

Permalink
title : select on initial title, css+
Browse files Browse the repository at this point in the history
  • Loading branch information
n0mad01 committed Apr 3, 2019
1 parent 9ac45f5 commit e2a4d5c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/app/core/components/titlebar/titlebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
AutoSizeInput
[includeBorders]="true"
[extraWidth]="2"
[class.my-class]=""
[ngClass]="{'initial-title': project_initial_title}"
(click)="!project_initial_title || projecttitle.select()"
>
</div>
</form>
4 changes: 4 additions & 0 deletions src/app/core/components/titlebar/titlebar.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ form {
&:focus {
border-color: #000000;
}

&.initial-title {
color: #CCC;
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/app/core/components/titlebar/titlebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from 'rxjs'

import {
_PROJECT_DEFAULT_TITLE_,
_PROJECT_TITLE_MAX_LENGTH_
} from '../../../config/project'

Expand All @@ -45,6 +46,7 @@ import * as fromProject from '../../../persistence/reducers'
export class TitlebarComponent implements OnInit {

@Input() project_title: string
@Input() project_initial_title: boolean
@Input() readonly general: Record<ProjectGeneralData>
@Input() readonly maxLength: 5

Expand All @@ -64,12 +66,14 @@ export class TitlebarComponent implements OnInit {
if(meta !== null) {
const title = meta.getIn(['general', 'title'])! as string
this.pnform!.controls['project_title'].setValue(title) //this.pnform!.patchValue({project_title: title})

// set css class when default title
this.project_initial_title = ((this.pnform!.value!.project_title! === _PROJECT_DEFAULT_TITLE_) ? true : false)
}
})
}

ngOnInit() {

this.pnform = this.formBldr.group({
project_title: [
this.project_title,
Expand Down

0 comments on commit e2a4d5c

Please sign in to comment.