From: matt Date: Mon, 10 May 2010 15:30:19 +0000 (+0000) Subject: should fix OSQA-155, toggle preview not working in answer form X-Git-Tag: live~938 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/f72b9230d9bb36b1bd752df22ef9a25136b972d1 should fix OSQA-155, toggle preview not working in answer form git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@191 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html index 0a75aba..47e654a 100644 --- a/forum/skins/default/templates/question.html +++ b/forum/skins/default/templates/question.html @@ -25,6 +25,17 @@ $("#" + answer_sort_tab).attr('className',"on"); $('#editor').TextAreaResizer(); + + //toggle preview of editor + var display = true; + var txt = "[{% trans "hide preview" %}]"; + $('#pre-collapse').text(txt); + $('#pre-collapse').bind('click', function(){ + txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]"; + display = !display; + $('#previewer').toggle(); + $('#pre-collapse').text(txt); + }); });