From 46449628e68934e7bc2f8874c15107c5a49592fb Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Thu, 13 Jun 2013 01:27:11 -0700 Subject: [PATCH] added ability to show help on F1 button click --- lib/client.js | 8 ++++---- lib/client/help.js | 10 ++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/client.js b/lib/client.js index ce7f490f..2a03aa8a 100644 --- a/lib/client.js +++ b/lib/client.js @@ -214,10 +214,10 @@ var Util, DOM, CloudFunc, CloudCmd; lFuncs =[ null, - null, /* f1 */ + CloudCmd.Help, /* f1 */ DOM.renameCurrent, /* f2 */ - CloudCmd.View, /* f3 */ - CloudCmd.Edit, /* f4 */ + CloudCmd.View, /* f3 */ + CloudCmd.Edit, /* f4 */ DOM.copyCurrent, /* f5 */ DOM.moveCurrent, /* f6 */ DOM.promptNewDir, /* f7 */ @@ -227,7 +227,7 @@ var Util, DOM, CloudFunc, CloudCmd; for(var i = 1; i <= 8; i++){ var lButton = 'f' + i, lEl = DOM.getById('f' + i); - if( i === 3 || i === 4) + if( i === 1 || i === 3 || i === 4) Events.addOneTime('click', lFuncs[i], lEl); else Events.addClick(lFuncs[i], lEl); diff --git a/lib/client/help.js b/lib/client/help.js index f26a7001..eb27fca8 100644 --- a/lib/client/help.js +++ b/lib/client/help.js @@ -53,14 +53,8 @@ var CloudCmd, Util, DOM; lKey = pEvent.keyCode; /* если клавиши можно обрабатывать */ - if (lIsBind) { - switch(lKey){ - - case lF1: - Help.show(); - break; - } - } + if (lIsBind && lKey === lF1) + Help.show(); } }