From 59d501a2f0810d503a9a47230941faf5c07aa445 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 15 Feb 2017 16:07:24 +0200 Subject: [PATCH] refactor(help) constructor -> module.exports --- client/help.js | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/client/help.js b/client/help.js index 1d8a3e6b..3a922400 100644 --- a/client/help.js +++ b/client/help.js @@ -1,31 +1,34 @@ 'use strict'; -/* global DOM, CloudCmd */ +/* global CloudCmd */ -window.CloudCmd.Help = HelpProto; +CloudCmd.Help = HelpProto; function HelpProto() { - const Images = DOM.Images; - const Help = this; + Images.show.load('top'); + show(); - function init() { - Images.show.load('top'); - Help.show(); - } - - this.show = () => { - CloudCmd - .Markdown - .show('/HELP.md', { - positionLoad : 'top', - relative : true - }); - }; - - this.hide = () => { - CloudCmd.View.hide(); - }; - - init(); + return exports; +} + +const {Images} = require('./dom'); + +module.exports.show = show; +module.exports.hide = hide; + +function show() { + const positionLoad = 'top'; + const relative = true; + + CloudCmd + .Markdown + .show('/HELP.md', { + positionLoad, + relative, + }); +} + +function hide() { + CloudCmd.View.hide(); }