feat: search for marketplace

This commit is contained in:
alexsparkes
2022-10-17 21:41:00 +01:00
parent 82bbd04cfb
commit 34b1834cd7
4 changed files with 34 additions and 28 deletions

View File

@@ -84,10 +84,11 @@ export default class QuickLinks extends PureComponent {
variables.stats.postEvent('feature', 'Quicklink add');
this.toggleAdd();
this.setState({
showAddLink: false,
});
// make sure image is correct size
this.setZoom(this.quicklinksContainer.current);
this.toggleAdd();
};
toggleAdd = () => {
@@ -96,20 +97,6 @@ export default class QuickLinks extends PureComponent {
});
};
// widget zoom
setZoom(element) {
const zoom = localStorage.getItem('zoomQuicklinks') || 100;
if (localStorage.getItem('quicklinksText')) {
for (const link of element.getElementsByTagName('a')) {
link.style.fontSize = `${1.4 * Number(zoom / 100)}em`;
}
} else {
for (const img of element.getElementsByTagName('img')) {
img.style.height = `${1.4 * Number(zoom / 100)}em`;
}
}
}
componentDidMount() {
EventBus.on('refresh', (data) => {
if (data === 'quicklinks') {
@@ -118,15 +105,12 @@ export default class QuickLinks extends PureComponent {
}
this.quicklinksContainer.current.style.display = 'block';
this.setZoom(this.quicklinksContainer.current);
this.setState({
items: JSON.parse(localStorage.getItem('quicklinks')),
});
}
});
this.setZoom(this.quicklinksContainer.current);
}
// allows you to add a link by pressing enter