mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-06 23:07:56 +08:00
36 lines
446 B
React
36 lines
446 B
React
|
|
||
|
// import window from 'window';
|
||
|
import $ from '$';
|
||
|
import _ from '_';
|
||
|
import {$body} from 'Common/Globals';
|
||
|
|
||
|
let
|
||
|
opened = false,
|
||
|
cmdDom = null;
|
||
|
|
||
|
/**
|
||
|
* @returns {void}
|
||
|
*/
|
||
|
function init()
|
||
|
{
|
||
|
if (null === cmdDom)
|
||
|
{
|
||
|
cmdDom = $('<div class="rl-cmd"></div>');
|
||
|
cmdDom.appendTo($body);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @returns {void}
|
||
|
*/
|
||
|
export function toggle()
|
||
|
{
|
||
|
init();
|
||
|
|
||
|
opened = !opened;
|
||
|
|
||
|
_.delay(() => {
|
||
|
cmdDom.toggleClass('opened', opened);
|
||
|
}, 50);
|
||
|
}
|