mirror of
https://github.com/mue/mue.git
synced 2026-07-16 13:34:03 +02:00
fix: custom js, reminder on reset button etc
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import React from 'react';
|
||||
|
||||
import LocalMallIcon from '@material-ui/icons/LocalMall';
|
||||
|
||||
import FileUpload from '../../settings/FileUpload';
|
||||
|
||||
@@ -41,18 +41,23 @@ export default class Slider extends React.PureComponent {
|
||||
numberWidth: ((value.length + 1) * this.widthCalculation)
|
||||
});
|
||||
|
||||
if (this.props.element) {
|
||||
if (!document.querySelector(this.props.element)) {
|
||||
document.querySelector('.reminder-info').style.display = 'block';
|
||||
return localStorage.setItem('showReminder', true);
|
||||
}
|
||||
}
|
||||
|
||||
EventBus.dispatch('refresh', this.props.category);
|
||||
}
|
||||
|
||||
resetItem = () => {
|
||||
localStorage.setItem(this.props.name, this.props.default);
|
||||
this.setState({
|
||||
value: this.props.default,
|
||||
numberWidth: ((this.props.default.length + 1) * this.widthCalculation)
|
||||
this.handleChange({
|
||||
target: {
|
||||
value: this.props.default || ''
|
||||
}
|
||||
});
|
||||
|
||||
toast(window.language.toasts.reset);
|
||||
EventBus.dispatch('refresh', this.props.category);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -37,13 +37,12 @@ export default class Text extends React.PureComponent {
|
||||
}
|
||||
|
||||
resetItem = () => {
|
||||
localStorage.setItem(this.props.name, this.props.default || '');
|
||||
this.setState({
|
||||
value: this.props.default || ''
|
||||
this.handleChange({
|
||||
target: {
|
||||
value: this.props.default || ''
|
||||
}
|
||||
});
|
||||
|
||||
toast(window.language.toasts.reset);
|
||||
EventBus.dispatch('refresh', this.props.category);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -46,7 +46,7 @@ export default class AdvancedSettings extends React.PureComponent {
|
||||
|
||||
<h3>{advanced.customisation}</h3>
|
||||
<Text title={advanced.tab_name} name='tabName' default={window.language.tabname} category='other'/>
|
||||
<Text title={advanced.custom_js} name='customjs' textarea={true} category='other'/>
|
||||
<Text title={advanced.custom_js} name='customjs' textarea={true} category='other' element='other'/>
|
||||
<Text title={advanced.custom_css} name='customcss' textarea={true} category='other'/>
|
||||
|
||||
<h3>{this.language.sections.experimental.title}</h3>
|
||||
|
||||
@@ -24,7 +24,7 @@ export default class BackgroundSettings extends React.PureComponent {
|
||||
}
|
||||
|
||||
let array = [];
|
||||
data.forEach(item => {
|
||||
data.forEach((item) => {
|
||||
array.push({
|
||||
name: item,
|
||||
value: item
|
||||
@@ -45,6 +45,7 @@ export default class BackgroundSettings extends React.PureComponent {
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
this.getQuoteLanguages();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user