work on compact ui option
This commit is contained in:
parent
f78e8c5fac
commit
0705a2e43f
3 changed files with 29 additions and 12 deletions
|
|
@ -12,6 +12,7 @@ var gs_moto_ui = exports;
|
||||||
let SELF = self,
|
let SELF = self,
|
||||||
lastGroup = null,
|
lastGroup = null,
|
||||||
lastDiv = null,
|
lastDiv = null,
|
||||||
|
addTo = null,
|
||||||
hideAction = null,
|
hideAction = null,
|
||||||
inputAction = null,
|
inputAction = null,
|
||||||
groups = {},
|
groups = {},
|
||||||
|
|
@ -24,7 +25,8 @@ var gs_moto_ui = exports;
|
||||||
SDB = moto.KV,
|
SDB = moto.KV,
|
||||||
DOC = SELF.document,
|
DOC = SELF.document,
|
||||||
prefix = "tab",
|
prefix = "tab",
|
||||||
NOMODE = "nomode";
|
NOMODE = "nomode",
|
||||||
|
compact = false;
|
||||||
|
|
||||||
SELF.$ = (SELF.$ || function (id) { return DOC.getElementById(id) } );
|
SELF.$ = (SELF.$ || function (id) { return DOC.getElementById(id) } );
|
||||||
|
|
||||||
|
|
@ -69,18 +71,19 @@ var gs_moto_ui = exports;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkpoint() {
|
function checkpoint() {
|
||||||
return { lastDiv, lastGroup };
|
return { addTo, lastDiv, lastGroup };
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore(opt) {
|
function restore(opt) {
|
||||||
if (opt) {
|
if (opt) {
|
||||||
|
addTo = opt.addTo;
|
||||||
lastDiv = opt.lastDiv;
|
lastDiv = opt.lastDiv;
|
||||||
lastGroup = opt.lastGroup;
|
lastGroup = opt.lastGroup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setGroup(div) {
|
function setGroup(div) {
|
||||||
lastDiv = div;
|
addTo = lastDiv = div;
|
||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -94,6 +97,15 @@ var gs_moto_ui = exports;
|
||||||
a = DOC.createElement('a'),
|
a = DOC.createElement('a'),
|
||||||
dbkey = `${prefix}-show-${label}`;
|
dbkey = `${prefix}-show-${label}`;
|
||||||
|
|
||||||
|
if (compact) {
|
||||||
|
let pop = DOC.createElement('div');
|
||||||
|
pop.setAttribute('class','popper');
|
||||||
|
row.appendChild(pop);
|
||||||
|
addTo = pop;
|
||||||
|
} else {
|
||||||
|
addTo = lastDiv;
|
||||||
|
}
|
||||||
|
|
||||||
div.appendChild(row);
|
div.appendChild(row);
|
||||||
row.setAttribute("class", "grouphead noselect");
|
row.setAttribute("class", "grouphead noselect");
|
||||||
row.appendChild(a);
|
row.appendChild(a);
|
||||||
|
|
@ -105,6 +117,7 @@ var gs_moto_ui = exports;
|
||||||
row.onclick = function() {
|
row.onclick = function() {
|
||||||
collapseGroup(label, dbkey);
|
collapseGroup(label, dbkey);
|
||||||
};
|
};
|
||||||
|
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -195,6 +208,7 @@ var gs_moto_ui = exports;
|
||||||
function newDiv(options) {
|
function newDiv(options) {
|
||||||
let div = DOC.createElement('div');
|
let div = DOC.createElement('div');
|
||||||
addModeControls(div, options);
|
addModeControls(div, options);
|
||||||
|
addTo.appendChild(div);
|
||||||
lastGroup.push(div);
|
lastGroup.push(div);
|
||||||
div._group = groupName;
|
div._group = groupName;
|
||||||
return div;
|
return div;
|
||||||
|
|
@ -262,7 +276,6 @@ var gs_moto_ui = exports;
|
||||||
addModeControls(btn, opt);
|
addModeControls(btn, opt);
|
||||||
addId(btn, opt);
|
addId(btn, opt);
|
||||||
|
|
||||||
lastDiv.appendChild(row);
|
|
||||||
row.appendChild(newLabel(label));
|
row.appendChild(newLabel(label));
|
||||||
row.appendChild(btn);
|
row.appendChild(btn);
|
||||||
row.setAttribute("class", "flow-row");
|
row.setAttribute("class", "flow-row");
|
||||||
|
|
@ -280,7 +293,6 @@ var gs_moto_ui = exports;
|
||||||
ip = height > 1 ? DOC.createElement('textarea') : DOC.createElement('input'),
|
ip = height > 1 ? DOC.createElement('textarea') : DOC.createElement('input'),
|
||||||
action = inputAction;
|
action = inputAction;
|
||||||
|
|
||||||
lastDiv.appendChild(row);
|
|
||||||
row.appendChild(newLabel(label));
|
row.appendChild(newLabel(label));
|
||||||
row.appendChild(ip);
|
row.appendChild(ip);
|
||||||
row.setAttribute("class", "flow-row");
|
row.setAttribute("class", "flow-row");
|
||||||
|
|
@ -345,7 +357,6 @@ var gs_moto_ui = exports;
|
||||||
hide = options && options.hide,
|
hide = options && options.hide,
|
||||||
action = inputAction;
|
action = inputAction;
|
||||||
|
|
||||||
lastDiv.appendChild(row);
|
|
||||||
if (label) row.appendChild(newLabel(label));
|
if (label) row.appendChild(newLabel(label));
|
||||||
row.appendChild(ip);
|
row.appendChild(ip);
|
||||||
row.setAttribute("class", "flow-row");
|
row.setAttribute("class", "flow-row");
|
||||||
|
|
@ -372,7 +383,6 @@ var gs_moto_ui = exports;
|
||||||
hide = options && options.hide,
|
hide = options && options.hide,
|
||||||
action = inputAction;
|
action = inputAction;
|
||||||
|
|
||||||
lastDiv.appendChild(row);
|
|
||||||
row.appendChild(newLabel(label));
|
row.appendChild(newLabel(label));
|
||||||
row.appendChild(ip);
|
row.appendChild(ip);
|
||||||
row.setAttribute("source", source || "tools");
|
row.setAttribute("source", source || "tools");
|
||||||
|
|
@ -395,8 +405,9 @@ var gs_moto_ui = exports;
|
||||||
ip = DOC.createElement('input'),
|
ip = DOC.createElement('input'),
|
||||||
hide = options && options.hide;
|
hide = options && options.hide;
|
||||||
|
|
||||||
lastDiv.appendChild(row);
|
if (label) {
|
||||||
if (label) row.appendChild(newLabel(label));
|
row.appendChild(newLabel(label));
|
||||||
|
}
|
||||||
row.appendChild(ip);
|
row.appendChild(ip);
|
||||||
row.setAttribute("class", "flow-row");
|
row.setAttribute("class", "flow-row");
|
||||||
row.style.display = hide ? 'none' : '';
|
row.style.display = hide ? 'none' : '';
|
||||||
|
|
@ -419,7 +430,6 @@ var gs_moto_ui = exports;
|
||||||
let row = newDiv(options),
|
let row = newDiv(options),
|
||||||
hide = options && options.hide;
|
hide = options && options.hide;
|
||||||
|
|
||||||
lastDiv.appendChild(row);
|
|
||||||
row.setAttribute("class", "flow-row");
|
row.setAttribute("class", "flow-row");
|
||||||
row.style.display = hide ? 'none' : '';
|
row.style.display = hide ? 'none' : '';
|
||||||
ip.setVisible = row.setVisible;
|
ip.setVisible = row.setVisible;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,15 @@
|
||||||
input[type=range]::-moz-focus-outer {
|
input[type=range]::-moz-focus-outer {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
.grouphead {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.popper {
|
||||||
|
position: absolute;
|
||||||
|
right: 50%;
|
||||||
|
top: 0;
|
||||||
|
z-index: 50000;
|
||||||
|
}
|
||||||
.dialog {
|
.dialog {
|
||||||
display: none;
|
display: none;
|
||||||
color: black;
|
color: black;
|
||||||
|
|
@ -59,7 +68,6 @@ input[type=range]::-moz-focus-outer {
|
||||||
#container {
|
#container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
#loading {
|
#loading {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,6 @@ th, tr, td, span, div, label, button {
|
||||||
#container {
|
#container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
xoverflow: hidden;
|
|
||||||
}
|
}
|
||||||
#control-left {
|
#control-left {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue