Merge pull request #1642 from LenAnderson/qr-settings-sortable-fix

This commit is contained in:
Cohee 2024-01-06 22:30:03 +02:00 committed by GitHub
commit ef3e51ccf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 0 deletions

View File

@ -39,6 +39,8 @@ export class QuickReplySetLink {
}
const set = document.createElement('select'); {
set.classList.add('qr--set');
// fix for jQuery sortable breaking childrens' touch events
set.addEventListener('touchstart', (evt)=>evt.stopPropagation());
set.addEventListener('change', ()=>{
this.set = QuickReplySet.get(set.value);
this.update();

View File

@ -158,6 +158,7 @@ export class SettingsUi {
// @ts-ignore
$(qrsDom).sortable({
delay: getSortableDelay(),
handle: '.drag-handle',
stop: ()=>this.onQrListSort(),
});
}

View File

@ -156,6 +156,9 @@
align-items: baseline;
padding: 0 0.5em;
}
#qr--settings .qr--setList > .qr--item > .drag-handle {
padding: 0.75em;
}
#qr--settings .qr--setList > .qr--item > .qr--visible {
flex: 0 0 auto;
display: flex;
@ -189,6 +192,9 @@
#qr--settings #qr--set-qrList .qr--set-qrListContents > .qr--set-item > :nth-child(5) {
flex: 0 0 auto;
}
#qr--settings #qr--set-qrList .qr--set-qrListContents > .qr--set-item > .drag-handle {
padding: 0.75em;
}
#qr--settings #qr--set-qrList .qr--set-qrListContents > .qr--set-item .qr--set-itemLabel,
#qr--settings #qr--set-qrList .qr--set-qrListContents > .qr--set-item .qr--action {
margin: 0;

View File

@ -174,6 +174,9 @@
gap: 0.5em;
align-items: baseline;
padding: 0 0.5em;
> .drag-handle {
padding: 0.75em;
}
> .qr--visible {
flex: 0 0 auto;
display: flex;
@ -200,6 +203,9 @@
> :nth-child(3) { flex: 0 0 auto; }
> :nth-child(4) { flex: 1 1 75%; }
> :nth-child(5) { flex: 0 0 auto; }
> .drag-handle {
padding: 0.75em;
}
.qr--set-itemLabel, .qr--action {
margin: 0;
}