mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Changelog: Tweaked spacing, count and element referencing
During review of #5663
This commit is contained in:
@ -25,6 +25,7 @@ export class PageEditor extends Component {
|
|||||||
this.draftDisplayIcon = this.$refs.draftDisplayIcon;
|
this.draftDisplayIcon = this.$refs.draftDisplayIcon;
|
||||||
this.changelogInput = this.$refs.changelogInput;
|
this.changelogInput = this.$refs.changelogInput;
|
||||||
this.changelogDisplay = this.$refs.changelogDisplay;
|
this.changelogDisplay = this.$refs.changelogDisplay;
|
||||||
|
this.changelogCounter = this.$refs.changelogCounter;
|
||||||
this.changeEditorButtons = this.$manyRefs.changeEditor || [];
|
this.changeEditorButtons = this.$manyRefs.changeEditor || [];
|
||||||
this.switchDialogContainer = this.$refs.switchDialog;
|
this.switchDialogContainer = this.$refs.switchDialog;
|
||||||
this.deleteDraftDialogContainer = this.$refs.deleteDraftDialog;
|
this.deleteDraftDialogContainer = this.$refs.deleteDraftDialog;
|
||||||
@ -77,8 +78,7 @@ export class PageEditor extends Component {
|
|||||||
const updateChangelogDebounced = debounce(this.updateChangelogDisplay.bind(this), 300, false);
|
const updateChangelogDebounced = debounce(this.updateChangelogDisplay.bind(this), 300, false);
|
||||||
this.changelogInput.addEventListener('input', () => {
|
this.changelogInput.addEventListener('input', () => {
|
||||||
const count = this.changelogInput.value.length;
|
const count = this.changelogInput.value.length;
|
||||||
const counterEl = document.getElementById('changelog-count');
|
this.changelogCounter.innerText = `${count} / 180`;
|
||||||
if (counterEl) counterEl.innerText = `${count} / 250`;
|
|
||||||
updateChangelogDebounced();
|
updateChangelogDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -104,17 +104,17 @@
|
|||||||
<span refs="page-editor@changelogDisplay">{{ trans('entities.pages_edit_set_changelog') }}</span>
|
<span refs="page-editor@changelogDisplay">{{ trans('entities.pages_edit_set_changelog') }}</span>
|
||||||
</button>
|
</button>
|
||||||
<ul refs="dropdown@menu" class="wide dropdown-menu">
|
<ul refs="dropdown@menu" class="wide dropdown-menu">
|
||||||
<li class="px-l py-m">
|
<li class="px-m py-s">
|
||||||
<p class="text-muted pb-s">{{ trans('entities.pages_edit_enter_changelog_desc') }}</p>
|
<p class="text-muted pb-s">{{ trans('entities.pages_edit_enter_changelog_desc') }}</p>
|
||||||
<textarea
|
<textarea
|
||||||
refs="page-editor@changelogInput"
|
refs="page-editor@changelogInput"
|
||||||
name="summary"
|
name="summary"
|
||||||
id="summary-input"
|
id="summary-input"
|
||||||
rows="2"
|
rows="2"
|
||||||
maxlength="250"
|
maxlength="180"
|
||||||
placeholder="{{ trans('entities.pages_edit_enter_changelog') }}"
|
placeholder="{{ trans('entities.pages_edit_enter_changelog') }}"
|
||||||
></textarea>
|
></textarea>
|
||||||
<small class="text-muted mt-xs" id="changelog-count">0 / 250</small>
|
<small refs="page-editor@changelogCounter" class="text-muted mt-xs">0 / 180</small>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<span>{{-- Prevents button jumping on menu show --}}</span>
|
<span>{{-- Prevents button jumping on menu show --}}</span>
|
||||||
|
Reference in New Issue
Block a user