summaryrefslogtreecommitdiff
path: root/src/static/js/pad_editbar.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/js/pad_editbar.js')
-rw-r--r--src/static/js/pad_editbar.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js
index 027fce82..fadbc09d 100644
--- a/src/static/js/pad_editbar.js
+++ b/src/static/js/pad_editbar.js
@@ -308,9 +308,6 @@ var padeditbar = (function()
var editbarPosition = 0;
function bodyKeyEvent(evt){
- // Check we're on a pad and not on the timeslider
- // Or some other window I haven't thought about!
- if(typeof pad === 'undefined') return false;
// If the event is Alt F9 or Escape & we're already in the editbar menu
// Send the users focus back to the pad
@@ -319,6 +316,10 @@ var padeditbar = (function()
// Close any dropdowns we have open..
padeditbar.toggleDropDown("none");
+ // Check we're on a pad and not on the timeslider
+ // Or some other window I haven't thought about!
+ if(typeof pad === 'undefined') return false;
+
// Shift focus away from any drop downs
$(':focus').blur(); // required to do not try to remove!
padeditor.ace.focus(); // Sends focus back to pad
@@ -366,9 +367,14 @@ var padeditbar = (function()
toolbar.registerCommand("import_export", function () {
toolbar.toggleDropDown("import_export", function(){
- setTimeout(function(){
- $('#importfileinput').focus();
- }, 100);
+ // If Import file input exists then focus on it..
+ if($('#importfileinput').length !== 0){
+ setTimeout(function(){
+ $('#importfileinput').focus();
+ }, 100);
+ }else{
+ $('.exportlink').first().focus();
+ }
});
});