mirror of
https://github.com/tabler/tabler.git
synced 2025-12-22 01:44:25 +04:00
Update demo.js
FF fix
This commit is contained in:
10
js/demo.js
10
js/demo.js
@@ -27,7 +27,7 @@ class TablerDemo {
|
|||||||
this.config = this.getConfig();
|
this.config = this.getConfig();
|
||||||
};
|
};
|
||||||
|
|
||||||
getConfig = function () {
|
getConfig() {
|
||||||
return {
|
return {
|
||||||
colorScheme: (localStorage.getItem('tablerColorScheme')) ? localStorage.getItem('tablerColorScheme') : 'light',
|
colorScheme: (localStorage.getItem('tablerColorScheme')) ? localStorage.getItem('tablerColorScheme') : 'light',
|
||||||
navPosition: (localStorage.getItem('tablerNavPosition')) ? localStorage.getItem('tablerNavPosition') : 'side',
|
navPosition: (localStorage.getItem('tablerNavPosition')) ? localStorage.getItem('tablerNavPosition') : 'side',
|
||||||
@@ -40,7 +40,7 @@ class TablerDemo {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
setConfig = function (key, value, availableValues, onSuccess) {
|
setConfig(key, value, availableValues, onSuccess) {
|
||||||
if (availableValues && availableValues.indexOf(value) !== -1) {
|
if (availableValues && availableValues.indexOf(value) !== -1) {
|
||||||
key = 'tabler' + key.charAt(0).toUpperCase() + key.slice(1);
|
key = 'tabler' + key.charAt(0).toUpperCase() + key.slice(1);
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ class TablerDemo {
|
|||||||
return this.getConfig();
|
return this.getConfig();
|
||||||
};
|
};
|
||||||
|
|
||||||
onSubmitForm = function () {
|
onSubmitForm() {
|
||||||
const form = this.form;
|
const form = this.form;
|
||||||
|
|
||||||
this.toggleColorScheme(form.querySelector('[name="color-scheme"]:checked').value);
|
this.toggleColorScheme(form.querySelector('[name="color-scheme"]:checked').value);
|
||||||
@@ -65,7 +65,7 @@ class TablerDemo {
|
|||||||
this.toggleSidebarFixed(form.querySelector('[name="sidebar-fixed"]:checked').value);
|
this.toggleSidebarFixed(form.querySelector('[name="sidebar-fixed"]:checked').value);
|
||||||
};
|
};
|
||||||
|
|
||||||
initFormControls = function() {
|
initFormControls() {
|
||||||
const config = this.getConfig();
|
const config = this.getConfig();
|
||||||
|
|
||||||
this.toggleColorScheme(config.colorScheme);
|
this.toggleColorScheme(config.colorScheme);
|
||||||
@@ -78,7 +78,7 @@ class TablerDemo {
|
|||||||
this.toggleSidebarFixed(config.sidebarFixed);
|
this.toggleSidebarFixed(config.sidebarFixed);
|
||||||
};
|
};
|
||||||
|
|
||||||
setFormValue = function(name, value,) {
|
setFormValue(name, value) {
|
||||||
if(this.form) {
|
if(this.form) {
|
||||||
let elements = this.form.querySelectorAll(`[name="${name}"]`);
|
let elements = this.form.querySelectorAll(`[name="${name}"]`);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user