summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--askbot/media/js/live_search.js9
-rw-r--r--askbot/templates/main_page/javascript.html1
-rw-r--r--askbot/templates/meta/bottom_scripts.html1
-rw-r--r--askbot/templates/user_profile/user_stats.html3
4 files changed, 8 insertions, 6 deletions
diff --git a/askbot/media/js/live_search.js b/askbot/media/js/live_search.js
index 5f536844..ef1b6e43 100644
--- a/askbot/media/js/live_search.js
+++ b/askbot/media/js/live_search.js
@@ -106,6 +106,7 @@ SearchDropMenu.prototype.makeKeyHandler = function() {
}
var itemCount = me.getItemCount();
if (itemCount > 0) {
+ //count is 0 with no title matches, curItem is 0 when none is selected
var curItem = me.getSelectedItemIndex();
if (keyCode === 38) {//upArrow
if (curItem > 0) {
@@ -116,8 +117,12 @@ SearchDropMenu.prototype.makeKeyHandler = function() {
curItem = curItem + 1;
}
} else if (keyCode === 13) {//enter
- me.navigateToItem(curItem);
- return false;
+ if (curItem === 0) {
+ return true;
+ } else {
+ me.navigateToItem(curItem);
+ return false;
+ }
}
me.selectItem(curItem);
return false
diff --git a/askbot/templates/main_page/javascript.html b/askbot/templates/main_page/javascript.html
index bb7190ce..0329d6b6 100644
--- a/askbot/templates/main_page/javascript.html
+++ b/askbot/templates/main_page/javascript.html
@@ -18,7 +18,6 @@
askbot['urls']['mark_subscribed_tag'] = '{% url mark_subscribed_tag %}';
askbot['urls']['unmark_tag'] = '{% url unmark_tag %}';
askbot['urls']['set_tag_filter_strategy'] = '{% url "set_tag_filter_strategy" %}';
- askbot['urls']['questions'] = '{% url "questions" %}';
askbot['urls']['question_url_template'] = scriptUrl + '{{'question/'|transurl}}{{ "{{QuestionID}}/" }}';
if (Modernizr.history) {
diff --git a/askbot/templates/meta/bottom_scripts.html b/askbot/templates/meta/bottom_scripts.html
index 9d535a2b..c3bff2f0 100644
--- a/askbot/templates/meta/bottom_scripts.html
+++ b/askbot/templates/meta/bottom_scripts.html
@@ -27,6 +27,7 @@
askbot['urls']['getEditor'] = '{% url "get_editor" %}';
askbot['urls']['titleSearch'] = '{% url "title_search" %}';
askbot['urls']['ask'] = '{% url "ask" %}';
+ askbot['urls']['questions'] = '{% url "questions" %}';
askbot['settings']['static_url'] = '{{ settings.STATIC_URL }}';
askbot['settings']['minSearchWordLength'] = {{settings.MIN_SEARCH_WORD_LENGTH}};
</script>
diff --git a/askbot/templates/user_profile/user_stats.html b/askbot/templates/user_profile/user_stats.html
index dc3d97e0..aa5aa07e 100644
--- a/askbot/templates/user_profile/user_stats.html
+++ b/askbot/templates/user_profile/user_stats.html
@@ -158,8 +158,5 @@
});
</script>
<script type='text/javascript' src='{{"/js/tag_selector.js"|media}}'></script>
- <script type="text/javascript">
- askbot['urls']['questions'] = '{% url "questions" %}';
- </script>
{% endblock %}
<!-- end user_stats.html -->