Commits

Ahmad Khayyat committed c323a8d

Include js for sever-side preview only when needed

  • Participants
  • Parent commits 520366c

Comments (0)

Files changed (1)

File mezzanine_pagedown/templates/mezzanine_pagedown/editor.html

       var editor_{{ id }} = new Markdown.Editor(converter_{{ id }}, "-{{ id }}");
       editor_{{ id }}.hooks.set("insertImageDialog", browseMediaLibrary);
       editor_{{ id }}.run();
-
+      {% if server_side_preview %}
       preview = function() {
         $.post('/pagedown/preview/',
           {text:$('#wmd-input-{{ id }}').val()},
       $('#wmd-button-bar-{{ id }}').on('click', preview);
       // initial preview on loading the page
       $(document).ready(preview);
+      {% endif %}
     })();
   </script>
 </div>