refining the status bar index...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-03-25 01:04:26 +03:00
parent 64e62120c6
commit 100d9045dc

View File

@ -113,13 +113,18 @@ var StatusBarActions = actions.Actions({
var n = keyboard.toKeyName(event.keyCode) var n = keyboard.toKeyName(event.keyCode)
var i = parseInt($(this).text())
i = i >= 1 ? i-1
: i == null ? 'current'
: i
// lose focus and exit... // lose focus and exit...
if(n == 'Esc' || n == 'Enter'){ if(n == 'Esc' || n == 'Enter'){
event.preventDefault() event.preventDefault()
// get image on enter... // get image on enter...
if(n == 'Enter'){ if(n == 'Enter'){
that.focusImage(parseInt($(this).text())-1 || 'current', that.focusImage(i,
item.hasClass('global') ? 'global' : undefined) item.hasClass('global') ? 'global' : undefined)
} }
@ -127,10 +132,7 @@ var StatusBarActions = actions.Actions({
window.getSelection().removeAllRanges() window.getSelection().removeAllRanges()
$(this).blur() $(this).blur()
// reset on esc...
if(n == 'Esc'){
that.updateStatusBar() that.updateStatusBar()
}
return false return false
} }
@ -140,7 +142,7 @@ var StatusBarActions = actions.Actions({
event.stopPropagation() event.stopPropagation()
that.config['status-bar-index']['live-update-on-edit'] that.config['status-bar-index']['live-update-on-edit']
&& that.focusImage(parseInt($(this).text())-1, && that.focusImage(i,
item.hasClass('global') ? 'global' : undefined) item.hasClass('global') ? 'global' : undefined)
}) })
.click(function(){ .click(function(){