Skip to content
Snippets Groups Projects
Commit 8c00c50c authored by Ruben Bimberg's avatar Ruben Bimberg :computer:
Browse files

Add spacing to toolbar

parent 2f35c92c
Branches
Tags
No related merge requests found
...@@ -24,15 +24,19 @@ ...@@ -24,15 +24,19 @@
&[data-mode=formula]::before { &[data-mode=formula]::before {
--quill-tooltip-label: var(--quill-tooltip-label-formula); --quill-tooltip-label: var(--quill-tooltip-label-formula);
} }
&[data-mode=video]::before { &[data-mode=video]::before {
--quill-tooltip-label: var(--quill-tooltip-label-video); --quill-tooltip-label: var(--quill-tooltip-label-video);
} }
&[data-mode=image]::before { &[data-mode=image]::before {
--quill-tooltip-label: var(--quill-tooltip-label-image); --quill-tooltip-label: var(--quill-tooltip-label-image);
} }
&[data-mode=link]::before { &[data-mode=link]::before {
--quill-tooltip-label: var(--quill-tooltip-label-link); --quill-tooltip-label: var(--quill-tooltip-label-link);
} }
&::before { &::before {
content: var(--quill-tooltip-label) !important; content: var(--quill-tooltip-label) !important;
} }
...@@ -87,6 +91,14 @@ ...@@ -87,6 +91,14 @@
&.ql-toolbar, .ql-toolbar { &.ql-toolbar, .ql-toolbar {
border-color: var(--on-surface); border-color: var(--on-surface);
.ql-formats {
margin-right: 0;
> * {
margin: 12px;
}
}
.ql-picker.ql-expanded { .ql-picker.ql-expanded {
.ql-picker-label { .ql-picker-label {
border-color: var(--on-surface); border-color: var(--on-surface);
......
...@@ -11,23 +11,12 @@ import { TranslateService } from '@ngx-translate/core'; ...@@ -11,23 +11,12 @@ import { TranslateService } from '@ngx-translate/core';
Quill.register('modules/imageResize', ImageResize); Quill.register('modules/imageResize', ImageResize);
const participantToolbar = [ const participantToolbar = [
['bold', 'strike'], ['bold', 'blockquote', 'code-block', { list: 'ordered' }, { list: 'bullet' }, 'link', 'formula', 'emoji']
['blockquote', 'code-block'],
[{ list: 'ordered' }, { list: 'bullet' }],
['link', 'formula'],
['emoji']
]; ];
const moderatorToolbar = [ const moderatorToolbar = [
['bold', 'strike'], ['bold', 'strike', 'blockquote', 'code-block', { header: 1 }, { header: 2 }, { list: 'ordered' }, { list: 'bullet' },
['blockquote', 'code-block'], { indent: '-1' }, { indent: '+1' }, { color: [] }, { align: [] }, 'link', 'image', 'video', 'formula', 'emoji'],
[{ header: 1 }, { header: 2 }],
[{ list: 'ordered' }, { list: 'bullet' }],
[{ indent: '-1' }, { indent: '+1' }],
[{ color: [] }],
[{ align: [] }],
['link', 'image', 'video', 'formula'],
['emoji']
]; ];
@Component({ @Component({
...@@ -51,7 +40,6 @@ export class ViewCommentDataComponent implements OnInit, AfterViewInit { ...@@ -51,7 +40,6 @@ export class ViewCommentDataComponent implements OnInit, AfterViewInit {
onDocumentClick: (e) => void; onDocumentClick: (e) => void;
}; };
currentText = ''; currentText = '';
quillModules: QuillModules = { quillModules: QuillModules = {
toolbar: { toolbar: {
container: participantToolbar, container: participantToolbar,
...@@ -61,11 +49,6 @@ export class ViewCommentDataComponent implements OnInit, AfterViewInit { ...@@ -61,11 +49,6 @@ export class ViewCommentDataComponent implements OnInit, AfterViewInit {
link: () => this.handleLink(), link: () => this.handleLink(),
formula: () => this.handle('formula') formula: () => this.handle('formula')
} }
},
'emoji-toolbar': true,
'emoji-shortname': true,
imageResize: {
modules: ['Resize', 'DisplaySize']
} }
}; };
...@@ -108,6 +91,13 @@ export class ViewCommentDataComponent implements OnInit, AfterViewInit { ...@@ -108,6 +91,13 @@ export class ViewCommentDataComponent implements OnInit, AfterViewInit {
if (this.user && this.user.role > 0) { if (this.user && this.user.role > 0) {
this.quillModules.toolbar['container'] = moderatorToolbar; this.quillModules.toolbar['container'] = moderatorToolbar;
} }
if (this.isEditor) {
this.quillModules['emoji-toolbar'] = true;
this.quillModules['emoji-shortname'] = true;
this.quillModules.imageResize = {
modules: ['Resize', 'DisplaySize']
};
}
this.translateService.use(localStorage.getItem('currentLang')); this.translateService.use(localStorage.getItem('currentLang'));
if (this.isEditor) { if (this.isEditor) {
this.updateCSSVariables(); this.updateCSSVariables();
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<ars-row ars-flex-box *ngIf="enabled" class="spellcheck"> <ars-row ars-flex-box *ngIf="enabled" class="spellcheck">
<ars-col> <ars-col>
<button <button
[disabled]="!commentData || commentData.currentText.length < 4" [disabled]="!commentData || commentData.currentText.length < 5"
mat-flat-button mat-flat-button
class="spell-button" class="spell-button"
(click)="checkGrammar()"> (click)="checkGrammar()">
......
...@@ -266,7 +266,6 @@ class Mark { ...@@ -266,7 +266,6 @@ class Mark {
} }
currentIndex += text.length; currentIndex += text.length;
} else { } else {
bounds.push([this.startIndex + currentIndex, 1]);
++currentIndex; ++currentIndex;
} }
} }
......
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