Browse Source

Revert "Fixed sizing for codeblocks"

This reverts commit c5e7b5f93d.
pull/11980/head
mpetrov 2 years ago
parent
commit
37cf3dbb42
  1. 4
      ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts
  2. 2
      ui-ngx/src/app/modules/home/components/widget/lib/home-page/getting-started-widget.component.scss
  3. 2
      ui-ngx/src/app/shared/components/markdown.component.scss

4
ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts

@ -139,14 +139,14 @@ export class EventContentDialogComponent extends DialogComponent<EventContentDia
let newWidth = 600; let newWidth = 600;
if (content && content.length > 0) { if (content && content.length > 0) {
const lines = content.split('\n'); const lines = content.split('\n');
newHeight = 18 * lines.length + 16; newHeight = 16 * lines.length + 16;
let maxLineLength = 0; let maxLineLength = 0;
lines.forEach((row) => { lines.forEach((row) => {
const line = row.replace(/\t/g, ' ').replace(/\n/g, ''); const line = row.replace(/\t/g, ' ').replace(/\n/g, '');
const lineLength = line.length; const lineLength = line.length;
maxLineLength = Math.max(maxLineLength, lineLength); maxLineLength = Math.max(maxLineLength, lineLength);
}); });
newWidth = 10 * maxLineLength + 16; newWidth = 8 * maxLineLength + 16;
} }
// newHeight = Math.min(400, newHeight); // newHeight = Math.min(400, newHeight);
this.renderer.setStyle(editorElement, 'minHeight', newHeight.toString() + 'px'); this.renderer.setStyle(editorElement, 'minHeight', newHeight.toString() + 'px');

2
ui-ngx/src/app/modules/home/components/widget/lib/home-page/getting-started-widget.component.scss

@ -118,7 +118,7 @@
padding: 0; padding: 0;
pre[class*=language-] { pre[class*=language-] {
margin: 0; margin: 0;
padding: 10px 38px 10px 16px; padding: 9px 38px 9px 16px;
background: rgba(0, 0, 0, 0.03); background: rgba(0, 0, 0, 0.03);
border-radius: 6px; border-radius: 6px;
border: none; border: none;

2
ui-ngx/src/app/shared/components/markdown.component.scss

@ -370,7 +370,7 @@
} }
&.line-numbers { &.line-numbers {
padding: 10px 16px 10px 66px; padding-left: 66px;
& > code { & > code {
span.line-numbers-rows { span.line-numbers-rows {

Loading…
Cancel
Save