You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2015/03/21 15:50:53 UTC

svn commit: r1668279 - in /ofbiz/trunk/specialpurpose/webpos/webapp/webpos: images/js/WebPosHotkeys.js shortcuts/Shortcuts.ftl

Author: mridulpathak
Date: Sat Mar 21 14:50:53 2015
New Revision: 1668279

URL: http://svn.apache.org/r1668279
Log:
[OFBIZ-5588] Error while pressing F9 (change quantity) in webpos. Thanks Hoan Dang Van for reporting the issue and pointing towards the possible solution.

Modified:
    ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/WebPosHotkeys.js
    ofbiz/trunk/specialpurpose/webpos/webapp/webpos/shortcuts/Shortcuts.ftl

Modified: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/WebPosHotkeys.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/WebPosHotkeys.js?rev=1668279&r1=1668278&r2=1668279&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/WebPosHotkeys.js (original)
+++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/WebPosHotkeys.js Sat Mar 21 14:50:53 2015
@@ -4,6 +4,5 @@ WebPosHotkeys = {
     bind: function (type, data, fnCode, fn, label) {
         var arr = [type, data, fnCode, fn, label];
         this.hotkeys.push(arr);
-        $(document).bind(type, data, fnCode);
     }
 }
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/shortcuts/Shortcuts.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/shortcuts/Shortcuts.ftl?rev=1668279&r1=1668278&r2=1668279&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/shortcuts/Shortcuts.ftl (original)
+++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/shortcuts/Shortcuts.ftl Sat Mar 21 14:50:53 2015
@@ -28,6 +28,52 @@ under the License.
 </table>
 <script type="text/javascript">
   function activateHotKeys() {
+    $(document).keydown(function(e){
+        switch (e.keyCode) {
+          case 112:
+            productToSearchFocus();
+            break;
+          case 113:
+            partyToSearchFocus();
+            break;
+          case 114:
+            payCash();
+            break;
+          case 115:
+            payCheck();
+            break;
+          case 116:
+            payGiftCard();
+            break;
+          case 117:
+            payCreditCard();
+            break;
+          case 118:
+            payFinish();
+            break;
+          case 119:
+            itemQuantityFocus();
+            break;
+          case 120:
+            incrementItemQuantity();
+            break;
+          case 121:
+            decrementItemQuantity();
+            break;
+          case 122:
+            emptyCart();
+            break;
+          case 38:
+            keyUp();
+            break;
+          case 40:
+            keyDown();
+            break;
+          default: return;
+        }
+        e.preventDefault();
+        return false;
+    });
     WebPosHotkeys.bind("keydown", "f1", productToSearchFocus, "productToSearchFocus()", "${uiLabelMap.WebPosShortcutF1}");
     WebPosHotkeys.bind("keydown", "f2", partyToSearchFocus, "partyToSearchFocus()", "${uiLabelMap.WebPosShortcutF2}");
     WebPosHotkeys.bind("keydown", "f3", payCash, "payCash()", "${uiLabelMap.WebPosShortcutF3}");