Commit 9be49823 authored by ibuler's avatar ibuler

[Update] 修改显示标题过长的问题

parent af656442
......@@ -44,7 +44,8 @@
font-family: 'Roboto', sans-serif;
font-size: 13px;
text-decoration: none;
padding-left: 24px;
padding-left: 12px;
padding-right: 14px;
line-height: 26px;
cursor: default;
width: 115px;
......@@ -68,7 +69,7 @@
}
.tabs ul li.active span {
padding-left: 24px;
padding-left: 12px;
line-height: 26px;
color: white;
height: 18px;
......
......@@ -7,7 +7,7 @@
<li *ngFor="let m of NavList.List;let i = index"
[ngClass]="{'active':i==NavList.Active,'disconnected':!m.connected, 'hidden': m.closed != false}"
id="termnav-{{i}}" (click)="setActive(i)" (dblclick)="m.edit=true;setActive(i)">
<span *ngIf="!m.edit">{{m.nick}}</span>
<span *ngIf="!m.edit">{{m.nick | truncatechars:25 }}</span>
<input *ngIf="m.edit" [(ngModel)]="m.nick" (blur)="m.edit=false" (keyup.enter)="m.edit=false" autofocus="true"/>
<a class="close" (click)="close(m,i)">&times;</a>
</li>
......
import {TransPipe} from './trans.pipe';
import {UtcDatePipe} from './date.pipe';
import {TruncatecharsPipe} from './truncatechars.pipe';
export const Pipes = [
UtcDatePipe,
TransPipe
TransPipe,
TruncatecharsPipe
];
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'truncatechars'})
export class TruncatecharsPipe implements PipeTransform {
transform(value: string, length: number): string {
if (!value) {
return value;
}
if (value.length < length) {
return value;
}
return value.slice(0, length) + '..';
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment