mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Code refactoring (3) (es5 -> es2015)
This commit is contained in:
parent
739ed215ea
commit
e49f3c6692
11 changed files with 619 additions and 571 deletions
35
dev/Common/Cmd.jsx
Normal file
35
dev/Common/Cmd.jsx
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
|
||||
// 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue