mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Merge branch 'enhance-changelog-textarea' of github.com:shresthkapoor7/BookStack into shresthkapoor7-enhance-changelog-textarea
This commit is contained in:
@ -75,7 +75,12 @@ export class PageEditor extends Component {
|
|||||||
|
|
||||||
// Changelog controls
|
// Changelog controls
|
||||||
const updateChangelogDebounced = debounce(this.updateChangelogDisplay.bind(this), 300, false);
|
const updateChangelogDebounced = debounce(this.updateChangelogDisplay.bind(this), 300, false);
|
||||||
this.changelogInput.addEventListener('input', updateChangelogDebounced);
|
this.changelogInput.addEventListener('input', () => {
|
||||||
|
const count = this.changelogInput.value.length;
|
||||||
|
const counterEl = document.getElementById('changelog-count');
|
||||||
|
if (counterEl) counterEl.innerText = `${count} / 250`;
|
||||||
|
updateChangelogDebounced();
|
||||||
|
});
|
||||||
|
|
||||||
// Draft Controls
|
// Draft Controls
|
||||||
onSelect(this.saveDraftButton, this.saveDraft.bind(this));
|
onSelect(this.saveDraftButton, this.saveDraft.bind(this));
|
||||||
|
@ -106,11 +106,15 @@
|
|||||||
<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-l py-m">
|
||||||
<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>
|
||||||
<input refs="page-editor@changelogInput"
|
<textarea
|
||||||
name="summary"
|
refs="page-editor@changelogInput"
|
||||||
id="summary-input"
|
name="summary"
|
||||||
type="text"
|
id="summary-input"
|
||||||
placeholder="{{ trans('entities.pages_edit_enter_changelog') }}" />
|
rows="2"
|
||||||
|
maxlength="250"
|
||||||
|
placeholder="{{ trans('entities.pages_edit_enter_changelog') }}"
|
||||||
|
></textarea>
|
||||||
|
<small class="text-muted mt-xs" id="changelog-count">0 / 250</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