Made sticky machine support adjustable through CSS instead of hard-coded
This commit is contained in:
parent
6f36583704
commit
82506638f8
2 changed files with 17 additions and 11 deletions
|
|
@ -53,18 +53,12 @@ function addStickyMachine(idMachine)
|
||||||
if (topMachine < 0) {
|
if (topMachine < 0) {
|
||||||
topMachine = findTop(machine);
|
topMachine = findTop(machine);
|
||||||
}
|
}
|
||||||
|
machine.className = machine.className.replace(/pcjs-machine-(floating|sticky) /g, '');
|
||||||
if (window.pageYOffset <= topMachine) {
|
if (window.pageYOffset <= topMachine) {
|
||||||
machine.style.position = 'relative';
|
machine.className = 'pcjs-machine-floating ' + machine.className;
|
||||||
machine.style.zIndex = 'auto';
|
|
||||||
machine.style.backgroundColor = '';
|
|
||||||
machine.style.paddingRight = 0;
|
|
||||||
if (machineSibling) machineSibling.style.paddingTop = 0;
|
if (machineSibling) machineSibling.style.paddingTop = 0;
|
||||||
} else {
|
} else {
|
||||||
machine.style.position = 'fixed';
|
machine.className = 'pcjs-machine-sticky ' + machine.className;
|
||||||
machine.style.zIndex = 1;
|
|
||||||
machine.style.backgroundColor = '#404040';
|
|
||||||
machine.style.paddingRight = '16px';
|
|
||||||
machine.style.top = 0;
|
|
||||||
if (machineSibling) machineSibling.style.paddingTop = machine.offsetHeight + 'px';
|
if (machineSibling) machineSibling.style.paddingTop = machine.offsetHeight + 'px';
|
||||||
}
|
}
|
||||||
if (prevOnScroll) prevOnScroll();
|
if (prevOnScroll) prevOnScroll();
|
||||||
|
|
@ -83,7 +77,7 @@ function addStickyMachine(idMachine)
|
||||||
*/
|
*/
|
||||||
function commandMachine(idMachine, typeComponent, sCommand, sValue)
|
function commandMachine(idMachine, typeComponent, sCommand, sValue)
|
||||||
{
|
{
|
||||||
|
console.log("commandMachine('" + idMachine + "','" + typeComponent + "','" + sCommand + "','" + sValue + "')");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,19 @@
|
||||||
.pcjs-copyright a {
|
.pcjs-copyright a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
.pcjs-machine-floating {
|
||||||
|
position: relative;
|
||||||
|
z-index: auto;
|
||||||
|
background-color: transparent;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
.pcjs-machine-sticky {
|
||||||
|
position: fixed !important;
|
||||||
|
z-index: 1 !important;
|
||||||
|
background-color: #404040 !important;
|
||||||
|
padding-right: 16px !important;
|
||||||
|
top: 0 !important;
|
||||||
|
}
|
||||||
@media screen and (max-width: 800px) {
|
@media screen and (max-width: 800px) {
|
||||||
.pcjs-textarea {
|
.pcjs-textarea {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue