diff options
author | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2011-10-06 10:45:19 -0300 |
---|---|---|
committer | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2011-10-06 10:45:19 -0300 |
commit | 064b14586c520c96739fa0d85ce0afa09ee4288a (patch) | |
tree | f8d6e9fe30dbbf5e227148823e5a8490a521feed | |
parent | 0b813b539e27236b3fbb17a8dd40a73b38783e6b (diff) | |
download | askbot-064b14586c520c96739fa0d85ce0afa09ee4288a.tar.gz askbot-064b14586c520c96739fa0d85ce0afa09ee4288a.tar.bz2 askbot-064b14586c520c96739fa0d85ce0afa09ee4288a.zip |
added on hash change event, need to change all the hashing system
-rw-r--r-- | askbot/skins/default/templates/question.html | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/askbot/skins/default/templates/question.html b/askbot/skins/default/templates/question.html index 893d1022..7e97a074 100644 --- a/askbot/skins/default/templates/question.html +++ b/askbot/skins/default/templates/question.html @@ -543,22 +543,9 @@ $('#fmanswer textarea').focus(); } {% if settings.ENABLE_SHARING_GOOGLE %}$.getScript("http://apis.google.com/js/plusone.js"){% endif %} - var queryset = window.location.search.substring(1); - var element_type = queryset.split('=')[0]; - var hash_value = window.location.hash.substring(1); - - if (element_type == 'answer'){ - var id_value = "#answer-container-" + hash_value; - }else if(element_type == "comment"){ - var id_value = '#' + hash_value; - } - - if (id_value != ""){ - var previous_color = $(id_value).css('background-color'); - $(id_value).animate({ backgroundColor: '#BEDA53' }, 500); - $(id_value).animate({backgroundColor: previous_color}, 500); - } + animate_hashes(); + {% if request.user == question.author %} $("#fmanswer_button").click(function() { $("#fmanswer").show(); @@ -566,6 +553,27 @@ }); {%endif%} }); + + $(window).bind('hashchange', animate_hashes); + + function animate_hashes(){ + var queryset = window.location.search.substring(1); + var element_type = queryset.split('=')[0]; + var hash_value = window.location.hash.substring(1); + + if (element_type == 'answer'){ + var id_value = "#answer-container-" + hash_value; + }else if(element_type == "comment"){ + var id_value = '#' + hash_value; + } + + if (id_value != ""){ + var previous_color = $(id_value).css('background-color'); + $(id_value).animate({ backgroundColor: '#BEDA53' }, 500); + $(id_value).animate({backgroundColor: previous_color}, 500); + } + } + function initEditor(){ $('#editor').TextAreaResizer(); |