]> git.openstreetmap.org Git - osqa.git/commitdiff
should fix OSQA-155, toggle preview not working in answer form
authormatt <matt@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 10 May 2010 15:30:19 +0000 (15:30 +0000)
committermatt <matt@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 10 May 2010 15:30:19 +0000 (15:30 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@191 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/templates/question.html

index 0a75abae5fc4cd4a9baa6e0cfdc7c46762866322..47e654a68d70168209ba70fc75d7da6178f87c34 100644 (file)
             $("#" + answer_sort_tab).attr('className',"on");\r
 \r
             $('#editor').TextAreaResizer();\r
+            \r
+            //toggle preview of editor\r
+            var display = true;\r
+            var txt = "[{% trans "hide preview" %}]";\r
+            $('#pre-collapse').text(txt);\r
+            $('#pre-collapse').bind('click', function(){\r
+                txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";\r
+                display = !display;\r
+                $('#previewer').toggle();\r
+                $('#pre-collapse').text(txt);\r
+            });\r
         });\r
         </script>\r
         <noscript>\r