diff --git a/lib/client/konsole.js b/lib/client/konsole.js index 65cfdfcd..e796b820 100644 --- a/lib/client/konsole.js +++ b/lib/client/konsole.js @@ -8,7 +8,7 @@ var CloudCmd, Util, join, DOM, CloudFunc, Console; function ConsoleProto() { var Name = 'Konsole', Element, - + Loaded, Images = DOM.Images, Dialog = DOM.Dialog, @@ -22,7 +22,7 @@ var CloudCmd, Util, join, DOM, CloudFunc, Console; CloudCmd.View, load, create, - show, + Konsole.show, ]); Element = DOM.load({ @@ -57,24 +57,24 @@ var CloudCmd, Util, join, DOM, CloudFunc, Console; }); } - function show(callback) { - CloudCmd.View.show(Element, { - afterShow: function() { - Console.focus(); - Util.exec(callback); - } - }); - } + this.show = function(callback) { + if (Loaded) + CloudCmd.View.show(Element, { + afterShow: function() { + Console.focus(); + Util.exec(callback); + } + }); + }; function load(callback) { DOM.load.js('/console/console.js', function(error) { if (error) { Dialog.alert(error.message); - Konsole.show = init; } else { + Loaded = true; Util.timeEnd(Name + ' load'); Util.exec(callback); - Konsole.show = show; } });