mirror of
https://github.com/mue/mue.git
synced 2026-07-20 07:24:08 +02:00
fix: improvements to quick links
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -178,5 +178,13 @@
|
||||
{
|
||||
"name": "backgroundVideoMute",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"name": "quicklinkstooltip",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"name": "notesEnabled",
|
||||
"value": true
|
||||
}
|
||||
]
|
||||
|
||||
@@ -36,7 +36,7 @@ export default class SettingsFunctions {
|
||||
|
||||
if (old !== null && !value) {
|
||||
if (old === 'true') {
|
||||
val = false;
|
||||
val = false;
|
||||
}
|
||||
|
||||
if (old === 'false') {
|
||||
|
||||
Reference in New Issue
Block a user