Simple fixes

This commit is contained in:
RainLoop Team 2016-08-30 23:24:02 +03:00
parent b28d4f8cf3
commit 9e38a59df3
4 changed files with 46 additions and 8 deletions

View file

@ -40,11 +40,40 @@ function cmdHelp(cmds) {
return require('Html/Cmds/Help.html').replace('{{ commands }}', cmds.join(' '));
}
/**
* @returns {void}
*/
function initGlass() {
let state = null;
try {
if (window.localStorage && window.localStorage.setItem)
{
state = '1' === '' + window.localStorage.getItem('rl-labs-glass');
}
}
catch (e) {} // eslint-disable-line no-empty
if (null !== state)
{
$html.toggleClass('glass', !!state);
}
}
/**
* @returns {string}
*/
function cmdGlass() {
$html.toggleClass('glass', !$html.hasClass('glass'));
const state = !$html.hasClass('glass');
try {
if (window.localStorage && window.localStorage.setItem)
{
window.localStorage.setItem('rl-labs-glass', state ? '1' : '0');
}
}
catch (e) {} // eslint-disable-line no-empty
$html.toggleClass('glass', state);
return '';
}
@ -199,8 +228,8 @@ class CmdContoller
onCmd(isTab) {
const
cmdLine = trim(this.cmd()).replace(/[\s]+/, ' '),
cmdParts = cmdLine.replace().split(/[\s]+/),
cmdLine = this.cmd().replace(/[\s]+/, ' '),
cmdParts = trim(cmdLine).replace().split(/[\s]+/),
cmd = cmdParts.shift();
if (isTab)
@ -348,3 +377,6 @@ export function toggle()
}, 50);
}
}
// init
initGlass();

View file

@ -6,6 +6,7 @@
right: 0;
top: auto;
height: 0;
z-index: 10000;
background: rgba(0, 0, 0, .85);
border-top: 1px solid #000;
@ -16,7 +17,7 @@
.transition(height 0.1s ease-out);
&.opened {
height: 300px;
height: 250px;
}
.rl-cmd-clr-error {

View file

@ -72,6 +72,8 @@
font-size: 18px;
height: 40px;
line-height: 20px;
padding-left: 12px;
padding-right: 12px;
}
}