1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Default templates: Cleaned up ux, added case for added endpoint

Cleaned up and updated page picker a bit, allowing longer names to show,
clicking through to item without triggering popup, and updated to use
hidden attributes instead of styles.

Added phpunit tests to cover supporting entity-selector-templates
endpoint.
This commit is contained in:
Dan Brown
2023-12-12 15:38:09 +00:00
parent d75eb06777
commit 2081a783f3
6 changed files with 47 additions and 16 deletions

View File

@ -1,7 +1,7 @@
import {Component} from './component';
function toggleElem(elem, show) {
elem.style.display = show ? null : 'none';
elem.toggleAttribute('hidden', !show);
}
export class PagePicker extends Component {
@ -21,6 +21,7 @@ export class PagePicker extends Component {
setupListeners() {
this.selectButton.addEventListener('click', this.showPopup.bind(this));
this.display.parentElement.addEventListener('click', this.showPopup.bind(this));
this.display.addEventListener('click', e => e.stopPropagation());
this.resetButton.addEventListener('click', () => {
this.setValue('', '');