mirror of
https://github.com/transmission/transmission
synced 2025-03-17 17:25:32 +00:00
feat: improved overflow menu for web client (#5895)
This commit is contained in:
parent
114885d67b
commit
b751b11918
3 changed files with 15 additions and 49 deletions
|
@ -1412,13 +1412,6 @@ $video-image: '../img/film.svg';
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
padding: 3px 0;
|
padding: 3px 0;
|
||||||
|
|
||||||
// hide the fullscreen button unless we're on mobile
|
|
||||||
@include for-tablet-portrait-up {
|
|
||||||
&.display-fullscreen-row {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
legend {
|
legend {
|
||||||
|
@ -1427,7 +1420,6 @@ $video-image: '../img/film.svg';
|
||||||
margin: 12px 0 4px;
|
margin: 12px 0 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a,
|
|
||||||
button,
|
button,
|
||||||
label {
|
label {
|
||||||
color: var(--color-fg-primary);
|
color: var(--color-fg-primary);
|
||||||
|
@ -1436,7 +1428,6 @@ $video-image: '../img/film.svg';
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
a,
|
|
||||||
button {
|
button {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: 0;
|
border: 0;
|
||||||
|
|
|
@ -10,7 +10,7 @@ export class AboutDialog extends EventTarget {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.elements = AboutDialog._create(version_info);
|
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);
|
document.body.append(this.elements.root);
|
||||||
this.elements.dismiss.focus();
|
this.elements.dismiss.focus();
|
||||||
}
|
}
|
||||||
|
@ -21,10 +21,6 @@ export class AboutDialog extends EventTarget {
|
||||||
delete this.elements;
|
delete this.elements;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDismiss() {
|
|
||||||
this.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
static _create(version_info) {
|
static _create(version_info) {
|
||||||
const elements = createDialogContainer('about-dialog');
|
const elements = createDialogContainer('about-dialog');
|
||||||
elements.root.setAttribute('aria-label', 'About transmission');
|
elements.root.setAttribute('aria-label', 'About transmission');
|
||||||
|
@ -48,6 +44,12 @@ export class AboutDialog extends EventTarget {
|
||||||
e.textContent = 'Copyright © The Transmission Project';
|
e.textContent = 'Copyright © The Transmission Project';
|
||||||
elements.workarea.append(e);
|
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();
|
elements.confirm.remove();
|
||||||
delete elements.confirm;
|
delete elements.confirm;
|
||||||
|
|
||||||
|
|
|
@ -459,6 +459,7 @@ export class OverflowMenu extends EventTarget {
|
||||||
|
|
||||||
for (const action_name of [
|
for (const action_name of [
|
||||||
'show-preferences-dialog',
|
'show-preferences-dialog',
|
||||||
|
'show-shortcuts-dialog',
|
||||||
'pause-all-torrents',
|
'pause-all-torrents',
|
||||||
'start-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);
|
actions[action_name] = make_button(section, text, action_name, on_click);
|
||||||
}
|
}
|
||||||
|
|
||||||
section = make_section('info', 'Info');
|
section = make_section('help', 'Help');
|
||||||
root.append(section);
|
root.append(section);
|
||||||
|
|
||||||
options = document.createElement('div');
|
options = document.createElement('div');
|
||||||
section.append(options);
|
section.append(options);
|
||||||
|
|
||||||
for (const action_name of [
|
for (const action_name of ['show-statistics-dialog', 'show-about-dialog']) {
|
||||||
'show-about-dialog',
|
|
||||||
'show-shortcuts-dialog',
|
|
||||||
'show-statistics-dialog',
|
|
||||||
]) {
|
|
||||||
const text = this.action_manager.text(action_name);
|
const text = this.action_manager.text(action_name);
|
||||||
actions[action_name] = make_button(options, text, action_name, on_click);
|
actions[action_name] = make_button(options, text, action_name, on_click);
|
||||||
}
|
}
|
||||||
|
|
||||||
section = make_section('links', 'Links');
|
const e = document.createElement('a');
|
||||||
root.append(section);
|
e.href = 'https://transmissionbt.com/donate.html';
|
||||||
|
e.target = '_blank';
|
||||||
options = document.createElement('ul');
|
e.textContent = 'Donate';
|
||||||
section.append(options);
|
options.append(e);
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
this._updateElement = this._updateElement.bind(this);
|
this._updateElement = this._updateElement.bind(this);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue