mirror of
https://github.com/flarum/core.git
synced 2025-02-25 11:43:19 +01:00
Validate color fields on appearance page
This commit is contained in:
parent
83e8503df1
commit
afe031f269
@ -69,6 +69,13 @@ export default class AppearancePage extends Component {
|
|||||||
onsubmit(e) {
|
onsubmit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
const hex = /^#[0-9a-f]{3}([0-9a-f]{3})?$/i;
|
||||||
|
|
||||||
|
if (!hex.test(this.primaryColor()) || !hex.test(this.secondaryColor())) {
|
||||||
|
alert('Please enter a hexadecimal color code.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
saveConfig({
|
saveConfig({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user