X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/268dcae115051f8d5fe9091d956a3f98b4b47e85..HEAD:/forum/skins/default/media/js/osqa.ask.js diff --git a/forum/skins/default/media/js/osqa.ask.js b/forum/skins/default/media/js/osqa.ask.js index 4bf05be..a2b6e55 100644 --- a/forum/skins/default/media/js/osqa.ask.js +++ b/forum/skins/default/media/js/osqa.ask.js @@ -1,8 +1,10 @@ var currentSideBar = 'div#title_side_bar'; function changeSideBar(enabled_bar) { - $(currentSideBar).hide(); - currentSideBar = enabled_bar; - $(currentSideBar).fadeIn('slow'); + if (enabled_bar != currentSideBar) { + $(currentSideBar).hide(); + currentSideBar = enabled_bar; + $(currentSideBar).fadeIn('slow'); + } } @@ -19,6 +21,7 @@ $(function() { var $input = $('#id_title'); var $box = $('#ask-related-questions'); var template = $('#question-summary-template').html(); + var $editor = $('#editor'); var results_cache = {}; @@ -80,7 +83,14 @@ $(function() { $input.keyup(reload_suggestions_box); $input.focus(reload_suggestions_box); - $input.blur(close_suggestions_box); + + $editor.change(function() { + if ($editor.html().length > 10) { + close_suggestions_box(); + } + }); + + // for chrome $input.keydown(focus_on_question);