From 43ce5a6327ecaa287d846d0ad63ebdbbd1904505 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Mon, 9 Mar 2015 00:24:28 +0200 Subject: client: fix scrolling of window on focus in feedback button (Fixes #366) This is actually a sort of workaround, since now you cannot use tab to focus on the feedback button, you have to click it with the mouse. Since most people (everybody?) would do that anyhow, it's good enough. An alternative is to change the 'botton: -3px' to anythin non-negative. I have not managed to capture or prevent the scrolling behaviour. What happens is that chrome tries to move the element into focus even though that is impossible since it is with a fixed position to an absolutely positioned element (body). --- src/client/main.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/client/main.js') diff --git a/src/client/main.js b/src/client/main.js index e615ce9a..dd21930d 100644 --- a/src/client/main.js +++ b/src/client/main.js @@ -1,6 +1,10 @@ define(['textanalysis.ui', 'textanalysis', 'buttons', 'history', 'drag_n_drop', 'robot', 'model/core', 'rz_core', 'view/selection', 'util', 'view/search', 'feedback', 'keyshortcuts'], function(textanalysis_ui, textanalysis, buttons, history, drag_n_drop, robot, model_core, rz_core, selection, util, search, feedback, keyshortcuts) { + function fix_feedback_scrolling_to_visibility_causing_topbar_to_slide_slowly_in_webkit() { + $('.feedback-btn').attr('tabindex', -1); + } + function expand(obj){ if (!obj.savesize) { obj.savesize = obj.size; @@ -49,6 +53,7 @@ function(textanalysis_ui, textanalysis, buttons, history, drag_n_drop, search.init(); selection.setup_toolbar(rz_core.main_graph); $.feedback({ajaxURL: rz_config.feedback_url}); + fix_feedback_scrolling_to_visibility_causing_topbar_to_slide_slowly_in_webkit(); } return { -- cgit v1.3.1