Commits

Ahmad Khayyat  committed db8fa5b

Run pagedown on $(document).ready()

Prevents JS errors when scripts are loaded in the footer.

  • Participants
  • Parent commits 456ad51

Comments (0)

Files changed (1)

File mezzanine_pagedown/templates/mezzanine_pagedown/editor.html

   <div id="wmd-preview-{{ id }}" class="wmd-panel wmd-preview"></div>
   {% endif %}
   <script type="text/javascript">
-    (function () {
+    $(document).ready(function () {
       var converter_{{ id }} = Markdown.getSanitizingConverter();
       var editor_{{ id }} = new Markdown.Editor(converter_{{ id }}, "-{{ id }}");
       editor_{{ id }}.hooks.set("insertImageDialog", browseMediaLibrary);
       // initial preview on loading the page
       $(document).ready(preview);
       {% endif %}
-    })();
+    });
   </script>
 </div>