fix: improvements to quick links

This commit is contained in:
David Ralph
2021-04-15 11:26:11 +01:00
parent 502f1683e2
commit f874f2a54c
5 changed files with 32 additions and 6 deletions

View File

@@ -167,8 +167,7 @@ legend {
padding-left: 10px;
border-radius: 15px;
margin-bottom: 10px;
font-size: 1.5rem;
width: 250px !important;
font-size: 1.325rem;
svg {
font-size: 1.3rem;

View File

@@ -33,12 +33,14 @@ export default class Notes extends React.PureComponent {
}
componentDidMount() {
const noteContainer = document.getElementById('noteContainer');
if (localStorage.getItem('notesPinned') === 'true') {
document.getElementById('noteContainer').classList.toggle('visibilityshow');
noteContainer.classList.toggle('visibilityshow');
}
if (localStorage.getItem('refresh') === 'false') {
document.getElementById('noteContainer').style.marginLeft = '-200px';
noteContainer.style.marginLeft = '-200px';
}
}

View File

@@ -33,9 +33,15 @@ export default class QuickLinks extends React.PureComponent {
addLink = () => {
let data = JSON.parse(localStorage.getItem('quicklinks'));
let url = this.state.url;
if (!url.startsWith('http://') && !url.startsWith('https://')) {
url = 'http://' + url;
}
data.push({
name: this.state.name,
url: this.state.url,
url: url,
key: Math.random().toString(36).substring(7) + 1
});
@@ -77,6 +83,17 @@ export default class QuickLinks extends React.PureComponent {
});
}
});
const addlink = document.querySelector('.topbarquicklinks');
addlink.onkeydown = (e) => {
e = e || window.event;
let code = e.which || e.keyCode;
if (code === 13 && this.state.showAddLink === 'visible') {
this.addLink();
e.preventDefault();
}
}
}
render() {

View File

@@ -178,5 +178,13 @@
{
"name": "backgroundVideoMute",
"value": true
},
{
"name": "quicklinkstooltip",
"value": true
},
{
"name": "notesEnabled",
"value": true
}
]

View File

@@ -36,7 +36,7 @@ export default class SettingsFunctions {
if (old !== null && !value) {
if (old === 'true') {
val = false;
val = false;
}
if (old === 'false') {