1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-07-04 06:10:18 +00:00

Add support for wide panels.

Allows for panels to be displayed in single column mode, regardless of screen width.
For more information, see updates to README.md
This commit is contained in:
Ian Gray
2022-01-08 21:25:10 +00:00
parent 9b228800f9
commit f5dd757240
6 changed files with 37 additions and 5 deletions

3
data/js/controls.js vendored
View File

@ -662,6 +662,7 @@ var rangeSlider = function (isDiscrete) {
var addToHTML = function(data) {
panelStyle = data.hasOwnProperty('panelStyle') ? " style='" + data.panelStyle + "' " : "";
elementStyle = data.hasOwnProperty('elementStyle') ? " style='" + data.elementStyle + "' " : "";
panelwide = data.hasOwnProperty('wide') ? "wide" : "";
if(!data.hasOwnProperty('parentControl') || $("#tab" + data.parentControl).length > 0) {
//We add the control with its own panel
@ -683,7 +684,7 @@ var addToHTML = function(data) {
case UI_GRAPH:
case UI_GAUGE:
case UI_ACCEL:
html = "<div id='id" + data.id + "' " + panelStyle + " class='two columns card tcenter " +
html = "<div id='id" + data.id + "' " + panelStyle + " class='two columns " + panelwide + " card tcenter " +
colorClass(data.color) + "'><h5>" + data.label + "</h5><hr/>" +
elementHTML(data.type, data.id, data.value, elementStyle) +
"</div>";