Skip to content

Commit

Permalink
Added show diff hihglight switch
Browse files Browse the repository at this point in the history
  • Loading branch information
pablojan committed May 22, 2017
1 parent aefde5d commit d924e8b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
Contributors
</div>



<div class="togglebutton text-center">
<label>
Highlight contributions
<input (click)="switchDiffHighlight()" value="showHighlight" type="checkbox">
<span class="toggle"></span>
</label>
</div>

<div *ngIf="!showEditNameForm && me.session.id" class="list-group-item">
<div class="row-picture">
<app-user-icon [participantSession]="me"></app-user-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@
}
}



.togglebutton {

margin-bottom: 1em;
border-bottom-color: $panel-separator-line-color;
border-bottom-style: solid;
border-bottom-width: 1px;
padding-bottom: 10px;
margin-bottom: 1em;

label {
font-size: 14px;

.toggle {
margin-left: 3em;
}
}
}

.list-group-separator {
margin-top: 0px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input } from "@angular/core";
import { Component, Input, Output, EventEmitter } from "@angular/core";
import * as Moment from "moment";

declare let window: any;
Expand All @@ -21,7 +21,9 @@ export class EditorParticipantsComponent {
private showEditNameForm: boolean = false;
private showParticipantsPastList: boolean = false;

private diffHighlight: boolean = false;

@Output() diffHighlightEvent: EventEmitter<any> = new EventEmitter();

private saveEditNameForm() {
this.showEditNameForm = false;
Expand All @@ -48,5 +50,10 @@ export class EditorParticipantsComponent {
this.showParticipantsPastList = !this.showParticipantsPastList;
}

private switchDiffHighlight() {
this.diffHighlight = !this.diffHighlight;
this.diffHighlightEvent.emit(this.diffHighlight);
}


}
3 changes: 2 additions & 1 deletion src/app/editor/editor.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
*ngIf="rightPanelContent == 'contributors'"
[me]="participantSessionMe"
[participantsRecent]="participantSessionsRecent"
[participantsPast]="participantSessionsPast">
[participantsPast]="participantSessionsPast"
(diffHighlightEvent)="onSwitchDiffHighlight($event)">
</jp-editor-participants>

<jp-editor-comments
Expand Down
9 changes: 9 additions & 0 deletions src/app/editor/editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -791,4 +791,13 @@ export class EditorComponent implements OnInit, OnDestroy {
private onCoverEvent(event) {
}

private onSwitchDiffHighlight(event) {
if (event) {
this.doc.get("text").showDiffHighlight();
} else {
this.doc.get("text").hideDiffHighlight();
}

}

}

0 comments on commit d924e8b

Please sign in to comment.