1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-30 19:03:04 +00:00

feat: improved overflow menu for web client (#5895)

This commit is contained in:
Rukario 2023-09-25 18:37:49 -07:00 committed by GitHub
parent 114885d67b
commit b751b11918
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 49 deletions

View file

@ -1412,13 +1412,6 @@ $video-image: '../img/film.svg';
display: flex;
flex-direction: row;
padding: 3px 0;
// hide the fullscreen button unless we're on mobile
@include for-tablet-portrait-up {
&.display-fullscreen-row {
display: none;
}
}
}
legend {
@ -1427,7 +1420,6 @@ $video-image: '../img/film.svg';
margin: 12px 0 4px;
}
a,
button,
label {
color: var(--color-fg-primary);
@ -1436,7 +1428,6 @@ $video-image: '../img/film.svg';
width: 100%;
}
a,
button {
background: transparent;
border: 0;

View file

@ -10,7 +10,7 @@ export class AboutDialog extends EventTarget {
super();
this.elements = AboutDialog._create(version_info);
this.elements.dismiss.addEventListener('click', () => this._onDismiss());
this.elements.dismiss.addEventListener('click', () => this.close());
document.body.append(this.elements.root);
this.elements.dismiss.focus();
}
@ -21,10 +21,6 @@ export class AboutDialog extends EventTarget {
delete this.elements;
}
_onDismiss() {
this.close();
}
static _create(version_info) {
const elements = createDialogContainer('about-dialog');
elements.root.setAttribute('aria-label', 'About transmission');
@ -48,6 +44,12 @@ export class AboutDialog extends EventTarget {
e.textContent = 'Copyright © The Transmission Project';
elements.workarea.append(e);
e = document.createElement('a');
e.href = 'https://transmissionbt.com/';
e.target = '_blank';
e.textContent = 'https://transmissionbt.com/';
elements.workarea.append(e);
elements.confirm.remove();
delete elements.confirm;

View file

@ -459,6 +459,7 @@ export class OverflowMenu extends EventTarget {
for (const action_name of [
'show-preferences-dialog',
'show-shortcuts-dialog',
'pause-all-torrents',
'start-all-torrents',
]) {
@ -466,50 +467,22 @@ export class OverflowMenu extends EventTarget {
actions[action_name] = make_button(section, text, action_name, on_click);
}
section = make_section('info', 'Info');
section = make_section('help', 'Help');
root.append(section);
options = document.createElement('div');
section.append(options);
for (const action_name of [
'show-about-dialog',
'show-shortcuts-dialog',
'show-statistics-dialog',
]) {
for (const action_name of ['show-statistics-dialog', 'show-about-dialog']) {
const text = this.action_manager.text(action_name);
actions[action_name] = make_button(options, text, action_name, on_click);
}
section = make_section('links', 'Links');
root.append(section);
options = document.createElement('ul');
section.append(options);
let e = document.createElement('a');
e.href = 'https://transmissionbt.com/';
e.tabindex = '0';
e.textContent = 'Homepage';
let li = document.createElement('li');
li.append(e);
options.append(li);
e = document.createElement('a');
e.href = 'https://transmissionbt.com/donate/';
e.tabindex = '0';
e.textContent = 'Tip Jar';
li = document.createElement('li');
li.append(e);
options.append(li);
e = document.createElement('a');
e.href = 'https://github.com/transmission/transmission/';
e.tabindex = '0';
e.textContent = 'Source Code';
li = document.createElement('li');
li.append(e);
options.append(li);
const e = document.createElement('a');
e.href = 'https://transmissionbt.com/donate.html';
e.target = '_blank';
e.textContent = 'Donate';
options.append(e);
this._updateElement = this._updateElement.bind(this);