From 100d9045dc9426a99a7b3af8f1616ca5a236717f Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 25 Mar 2016 01:04:26 +0300 Subject: [PATCH] refining the status bar index... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-status.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ui (gen4)/features/ui-status.js b/ui (gen4)/features/ui-status.js index 42f85cef..915240ca 100755 --- a/ui (gen4)/features/ui-status.js +++ b/ui (gen4)/features/ui-status.js @@ -113,13 +113,18 @@ var StatusBarActions = actions.Actions({ var n = keyboard.toKeyName(event.keyCode) + var i = parseInt($(this).text()) + i = i >= 1 ? i-1 + : i == null ? 'current' + : i + // lose focus and exit... if(n == 'Esc' || n == 'Enter'){ event.preventDefault() // get image on enter... if(n == 'Enter'){ - that.focusImage(parseInt($(this).text())-1 || 'current', + that.focusImage(i, item.hasClass('global') ? 'global' : undefined) } @@ -127,10 +132,7 @@ var StatusBarActions = actions.Actions({ window.getSelection().removeAllRanges() $(this).blur() - // reset on esc... - if(n == 'Esc'){ - that.updateStatusBar() - } + that.updateStatusBar() return false } @@ -140,7 +142,7 @@ var StatusBarActions = actions.Actions({ event.stopPropagation() that.config['status-bar-index']['live-update-on-edit'] - && that.focusImage(parseInt($(this).text())-1, + && that.focusImage(i, item.hasClass('global') ? 'global' : undefined) }) .click(function(){