summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--askbot/skins/default/templates/embed/ask_by_widget.html4
-rwxr-xr-xaskbot/skins/default/templates/embed/askbot_widget.js8
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