Skip to content

Commit

Permalink
add glitchy, hidden edit button option to cardDisplayDialog
Browse files Browse the repository at this point in the history
see #16 #17
  • Loading branch information
UnwarySage committed Oct 27, 2017
1 parent 2c968b6 commit 73f7c96
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,3 @@
margin-left: 1em;
}

.button{
border-radius: 2px;
border-style:none;
background-color: lightgreen;
padding:15px;
padding-right:18px;
padding-left:18px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ <h4 mat-line class="card-cont">{{General_sense}}</h4>
<div>
<h4 mat-line class="card-cont">{{Example_usage}}</h4>
</div>

</mat-list>
<div id="button-controls">
<hr>
<button class="button">Edit</button>
</div>
</mat-dialog-content>
<mat-dialog-actions *ngIf="editShown" id="button-controls">
<button mat-raised-button class="card-edit-fab" mat-tooltip="Peek At Hints" matTooltipPosition="right">
<mat-icon class="md-24" aria-label="Edit Card">mode edit</mat-icon>
</button>
</mat-dialog-actions>



Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {MatDialogConfig, MatDialogRef, MatSnackBar, MAT_DIALOG_DATA} from "@angu
})
export class CardDisplayDialogComponent implements OnInit {

constructor(public matDialogRef: MatDialogRef<CardDisplayDialogComponent>,
constructor( public matDialogRef: MatDialogRef<CardDisplayDialogComponent>,
@Inject(MAT_DIALOG_DATA)
public data: { Word: string, Synonym: string, Antonym: string, General_sense: string, Example_usage: string })
public data: { Word: string, Synonym: string, Antonym: string, General_sense: string, Example_usage: string, editShown:boolean })
{ }


Expand All @@ -20,6 +20,7 @@ export class CardDisplayDialogComponent implements OnInit {
Antonym: string;
General_sense: string;
Example_usage: string;
editShown: boolean;

// @Input() card: Card;

Expand All @@ -29,8 +30,12 @@ export class CardDisplayDialogComponent implements OnInit {
this.Antonym = this.data.Antonym;
this.General_sense = this.data.General_sense;
this.Example_usage = this.data.Example_usage;
this.editShown = this.data.editShown;
console.log(this.data);
console.log(this.Word);
}

setEditShown(value: boolean){
this.editShown = value;
}
}
3 changes: 2 additions & 1 deletion client/src/app/card-list-component/card-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ export class CardListComponent implements OnInit {
Synonym: presentCard.synonym,
Antonym: presentCard.antonym,
General_sense: presentCard.general_sense,
Example_usage: presentCard.example_usage
Example_usage: presentCard.example_usage,
};
console.log(config);

let cardRef = this.peek.open(CardDisplayDialogComponent, config);
// cardRef.setEditShown(true);
};

constructor(public CardListService: CardListService,public peek: MdDialog) {
Expand Down

0 comments on commit 73f7c96

Please sign in to comment.