]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/media/js/osqa.ask.js
Adds the user menu to the injectable places, makes several improvements in the user...
[osqa.git] / forum / skins / default / media / js / osqa.ask.js
index e5e8c20a094571335f536689a8ff34c187fdb7a8..36da8aab9921fbf3862904691dca0917b5db41a6 100644 (file)
@@ -9,9 +9,9 @@ $(function () {
     $('div#editor_side_bar').hide();
     $('div#tags_side_bar').hide();
 
-    $('input#id_title').focus(function(){changeSideBar('div#title_side_bar')});
-    $('textarea#editor').focus(function(){changeSideBar('div#editor_side_bar')});
-    $('input#id_tags').focus(function(){changeSideBar('div#tags_side_bar')});
+    $('#id_title').focus(function(){changeSideBar('div#title_side_bar')});
+    $('#editor').focus(function(){changeSideBar('div#editor_side_bar')});
+    $('#id_tags').focus(function(){changeSideBar('div#tags_side_bar')});
 });
 
 $(function() {
@@ -22,7 +22,7 @@ $(function() {
     var results_cache = {};
 
     function reload_suggestions_box(e) {
-        var q = $input.val().trim();
+        var q = $input.val().replace(/^\s+|\s+$/g,"");
 
         if (q.length == 0) {
             $('#ask-related-questions').html('');
@@ -36,7 +36,7 @@ $(function() {
 
         $.post(related_questions_url, {title: q}, function(data) {
             if (data) {
-                var c = $input.val().trim();
+                var c = $input.val().replace(/^\s+|\s+$/g,"");
 
                 if (c != q) {
                     return;