Skip to content

Commit

Permalink
fix: add titles for image and link menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed May 13, 2021
1 parent deaa215 commit d8de693
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ NgxEditorModule.forRoot({
align_justify: 'Justify',
text_color: 'Text Color',
background_color: 'Background Color',
insertLink: 'Insert Link',
removeLink: 'Remove Link',
insertImage: 'Insert Image',

// pupups, forms, others...
url: 'URL',
Expand Down
3 changes: 3 additions & 0 deletions projects/ngx-editor/src/lib/Locals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const defaults: Record<string, string> = {
align_justify: 'Justify',
text_color: 'Text Color',
background_color: 'Background Color',
insertLink: 'Insert Link',
removeLink: 'Remove Link',
insertImage: 'Insert Image',

// pupups, forms, others...
url: 'URL',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="NgxEditor__MenuItem--IconContainer" [innerHTML]="icon | sanitizeHtml" (mousedown)="onMouseDown($event)">
<div class="NgxEditor__MenuItem--IconContainer" [innerHTML]="icon | sanitizeHtml" (mousedown)="onMouseDown($event)" [title]="getLabel('insertImage')">
</div>

<!-- popup -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="NgxEditor__MenuItem--IconContainer" [innerHTML]="icon | sanitizeHtml" (mousedown)="onMouseDown($event)">
<div class="NgxEditor__MenuItem--IconContainer" [innerHTML]="icon | sanitizeHtml" (mousedown)="onMouseDown($event)" [title]="title">
</div>

<!-- popup -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export class LinkComponent implements OnInit, OnDestroy {
return Icon.get(this.isActive ? 'unlink' : 'link');
}

get title(): string {
return this.ngxeService.locals.get(this.isActive ? 'removeLink' : 'insertLink');
}

get href(): AbstractControl {
return this.form.get('href');
}
Expand Down

0 comments on commit d8de693

Please sign in to comment.