diff options
author | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2012-08-30 12:04:20 -0600 |
---|---|---|
committer | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2012-08-30 12:04:20 -0600 |
commit | 4f573875157e51ce3e4a9771b1cea2df7bcc3d04 (patch) | |
tree | 36637421675d7d5383ea2102eec6425a5a88ba8c | |
parent | 73b309df847778abf3ca21b264c8ed36de66b8c0 (diff) | |
download | askbot-4f573875157e51ce3e4a9771b1cea2df7bcc3d04.tar.gz askbot-4f573875157e51ce3e4a9771b1cea2df7bcc3d04.tar.bz2 askbot-4f573875157e51ce3e4a9771b1cea2df7bcc3d04.zip |
set focus on the askwidget title element
-rw-r--r-- | askbot/skins/default/templates/embed/ask_by_widget.html | 4 | ||||
-rwxr-xr-x | askbot/skins/default/templates/embed/askbot_widget.js | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/askbot/skins/default/templates/embed/ask_by_widget.html b/askbot/skins/default/templates/embed/ask_by_widget.html index 3a5e7bb0..a82cf24b 100644 --- a/askbot/skins/default/templates/embed/ask_by_widget.html +++ b/askbot/skins/default/templates/embed/ask_by_widget.html @@ -128,6 +128,9 @@ var minSearchWordLength = {{settings.MIN_SEARCH_WORD_LENGTH}}; askbot['urls']['api_get_questions'] = '{% url api_get_questions %}'; liveSearchNewThreadInit(); + $(document).ready(function(){ + $("#id_title").focus(); + }); </script> <script type='text/javascript' src='{{"/js/editor.js"|media}}'></script> @@ -138,3 +141,4 @@ {% include "meta/tinymce.html" %} {% endif %} {% endblock %} +
\ No newline at end of file diff --git a/askbot/skins/default/templates/embed/askbot_widget.js b/askbot/skins/default/templates/embed/askbot_widget.js index 57cead90..a6b48452 100755 --- a/askbot/skins/default/templates/embed/askbot_widget.js +++ b/askbot/skins/default/templates/embed/askbot_widget.js @@ -3,6 +3,9 @@ var {{variable_name}} = { widgetToggle: function() { element = document.getElementById({{variable_name}}.element_id); element.style.visibility = (element.style.visibility == "visible") ? "hidden" : "visible"; + if (element.style.visibility == "visible"){ + $("#" + {{variable_name}}.element_id + " iframe").focus(); + } }, toHtml: function() { var html = {{variable_name}}.createButton(); @@ -14,7 +17,6 @@ var {{variable_name}} = { //creating the div var motherDiv = document.createElement('div'); motherDiv.setAttribute("id", {{variable_name}}.element_id); - console.log(motherDiv); var containerDiv = document.createElement('div'); motherDiv.appendChild(containerDiv); @@ -40,7 +42,6 @@ var {{variable_name}} = { var body = document.getElementsByTagName('body')[0]; if (body){ - console.log(body.firstChild); body.insertBefore(motherDiv, body.firstChild); body.insertBefore(link, body.firstChild); } @@ -68,6 +69,5 @@ var onload_functions = function(){ {{variable_name}}.toHtml(); } -console.log(onload_functions); window.onload = onload_functions(); -document.write({{variable_name}}.createButton().outerHTML); +document.write({{variable_name}}.createButton().outerHTML);
\ No newline at end of file |