From 24e6e1728a020e38e023df0a09ad38941ba0dd82 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 31 Mar 2015 15:00:43 +0100 Subject: [PATCH] I came to bring the rain.. Let me get my coat... Fix focus on timeslider import export --- src/static/css/timeslider.css | 19 ++++++++++++++++++- src/static/js/pad_editbar.js | 18 ++++++++++++------ src/templates/timeslider.html | 6 +++--- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/static/css/timeslider.css b/src/static/css/timeslider.css index 49f89421..7bff7341 100644 --- a/src/static/css/timeslider.css +++ b/src/static/css/timeslider.css @@ -78,6 +78,7 @@ width: 44px; text-align:center; vertical-align:middle; + background:none; } #playpause_button { right: 77px; @@ -125,7 +126,7 @@ font-family: fontawesome-etherpad; border-radius:2px; border: #666 solid 1px; - line-height:18px; +/* line-height:18px; */ text-align:center; height:22px; color:#666; @@ -337,3 +338,19 @@ OL { .list-number6 { list-style-type: lower-roman } + +button{ + margin:0; + padding:0; + cursor:pointer; +} + +button::-moz-focus-inner { + padding: 0; + border: 0 +} + +button:focus{ + border: 1px solid #666; +} + 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(); + } }); }); diff --git a/src/templates/timeslider.html b/src/templates/timeslider.html index a619c702..20688ea8 100644 --- a/src/templates/timeslider.html +++ b/src/templates/timeslider.html @@ -61,11 +61,11 @@
-
+
-
-
+ +