Minor UI optimisations.

This commit is contained in:
Blaz Kristan 2021-07-22 15:34:43 +02:00
parent 611816c8e3
commit 9e583f9ff0
3 changed files with 817 additions and 818 deletions

View File

@ -39,8 +39,8 @@ var hol = [
var cpick = new iro.ColorPicker("#picker", { var cpick = new iro.ColorPicker("#picker", {
width: 260, width: 260,
wheelLightness: false, wheelLightness: false,
wheelAngle: 90, wheelAngle: 90,
layout: [ layout: [
{ {
component: iro.ui.Wheel, component: iro.ui.Wheel,
options: {} options: {}
@ -212,17 +212,17 @@ function onLoad()
method: 'get' method: 'get'
}) })
.then(res => { .then(res => {
//if (!res.ok) showErrorToast();
return res.json(); return res.json();
}) })
.then(json => { .then(json => {
if (Array.isArray(json)) hol = json; if (Array.isArray(json)) hol = json;
//TODO: do some parsing first //TODO: do some parsing first
loadBg(cfg.theme.bg.url);
}) })
.catch(function (error) { .catch(function(error){
loadBg(cfg.theme.bg.url);
console.log("holidays.json does not contain array of holidays. Defaults loaded."); console.log("holidays.json does not contain array of holidays. Defaults loaded.");
})
.finally(function(){
loadBg(cfg.theme.bg.url);
}); });
} else } else
loadBg(cfg.theme.bg.url); loadBg(cfg.theme.bg.url);
@ -461,7 +461,6 @@ function loadPalettes(callback = null)
}) })
.catch(function (error) { .catch(function (error) {
showToast(error, true); showToast(error, true);
console.log(error);
presetError(false); presetError(false);
if (callback) callback(); if (callback) callback();
}); });
@ -479,13 +478,13 @@ function loadFX(callback = null)
return res.json(); return res.json();
}) })
.then(json => { .then(json => {
clearErrorToast();
eJson = Object.entries(json); eJson = Object.entries(json);
populateEffects(); populateEffects();
if (callback) callback(); if (callback) callback();
}) })
.catch(function (error) { .catch(function (error) {
showToast(error, true); showToast(error, true);
console.log(error);
presetError(false); presetError(false);
if (callback) callback(); if (callback) callback();
}); });
@ -1154,7 +1153,7 @@ function readState(s,command=false)
if (isRgbw) whites[e] = parseInt(w); if (isRgbw) whites[e] = parseInt(w);
selectSlot(csel); selectSlot(csel);
} }
gId('sliderSpeed').value = whites[csel]; gId('sliderW').value = whites[csel];
gId('sliderSpeed').value = i.sx; gId('sliderSpeed').value = i.sx;
gId('sliderIntensity').value = i.ix; gId('sliderIntensity').value = i.ix;

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
*/ */
// version code in format yymmddb (b = daily build) // version code in format yymmddb (b = daily build)
#define VERSION 2107191 #define VERSION 2107221
//uncomment this if you have a "my_config.h" file you'd like to use //uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG //#define WLED_USE_MY_CONFIG