diff --git a/static/js/infoView.js b/static/js/infoView.js index 0da0c36..4dd7c43 100644 --- a/static/js/infoView.js +++ b/static/js/infoView.js @@ -704,6 +704,11 @@ oml.ui.infoView = function(identifyData) { } } }); + that.bindEvent({ + mousedown: function() { + that.gainFocus(); + } + }) return that; diff --git a/static/js/mainMenu.js b/static/js/mainMenu.js index adec538..a165652 100644 --- a/static/js/mainMenu.js +++ b/static/js/mainMenu.js @@ -501,15 +501,16 @@ oml.ui.mainMenu = function() { that[data.value ? 'enableItem' : 'disableItem']('showinfo'); }, }); - Ox.Event.bind('key', function(data, event, element) { - var key = event.replace(/^key\./, ''); - if (key == 'backtick') { + Ox.Event.bind({ + key_backtick: function() { changeFocus(1); - } else if (key == 'control_comma') { + }, + key_control_comma: function() { if (!oml.hasDialogOrScreen()) { oml.UI.set({page: 'preferences'}); } - } else if (key == 'control_f') { + }, + key_control_f: function() { if (!oml.hasDialogOrScreen()) { if (ui._findState.key != 'advanced') { setTimeout(function() { @@ -519,38 +520,49 @@ oml.ui.mainMenu = function() { oml.$ui.filterDialog = oml.ui.filterDialog().open(); } } - } else if (key == 'control_m') { + }, + key_control_m: function() { if (!oml.hasDialogOrScreen() && !that.isSelected()) { that.options('menus')[0].element.trigger('click'); } - } else if (key == 'control_shift_f') { + }, + key_control_shift_f: function() { Ox.print('FIXME: NOT IMPLEMENTED') - } else if (key == 'control_shift_w') { + }, + key_control_shift_w: function() { if (!oml.hasDialogOrScreen()) { oml.UI.set({ find: oml.config.user.ui.find, item: '' }); } - } else if (key == 'control_shift_z') { + }, + key_control_shift_z: function() { oml.redoHistory(); - } else if (key == 'control_slash') { + }, + key_control_slash: function() { if (!oml.hasDialogOrScreen()) { oml.UI.set({page: 'help'}); } - } else if (key == 'control_w') { + }, + key_control_w: function() { if (!oml.hasDialogOrScreen()) { oml.UI.set({item: ''}); } - } else if (key == 'control_z') { + }, + key_control_z: function() { oml.undoHistory(); - } else if (key == 'shift_b') { + }, + key_shift_b: function() { ui.item && oml.UI.set({showBrowser: !ui.showBrowser}); - } else if (key == 'shift_f') { + }, + key_shift_f: function() { !ui.item && oml.UI.set({showFilters: !ui.showFilters}); - } else if (key == 'shift_i') { + }, + key_shift_i: function() { ui.showSidebar && oml.UI.set({showInfo: !ui.showInfo}); - } else if (key == 'shift_s') { + }, + key_shift_s: function() { oml.UI.set({showSidebar: !ui.showSidebar}); } });