Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Call the tinyMCE function through the custom modal dialog function

Roland Geiderc44ddedeab4d
diff --git a/exercises/templates/view.html b/exercises/templates/view.html
index 9eb5cc89b..bfaa66d05 100644
--- a/exercises/templates/view.html
+++ b/exercises/templates/view.html
@@ -9,6 +9,12 @@
<script src="{% static "js/workout-manager.js" %}"></script>
<script>
+function custom_modal_init()
+{
+ // Set up the tinyMCE editor on modal dialogs
+ init_tinymce();
+}
+
$(document).ready(function() {
// Init the modal dialog to edit the exercise
diff --git a/manager/static/js/workout-manager.js b/manager/static/js/workout-manager.js
index 4804b1af9..dda588318 100644
--- a/manager/static/js/workout-manager.js
+++ b/manager/static/js/workout-manager.js
@@ -216,9 +216,6 @@ function form_modal_dialog()
var targetUrl = $(this).attr("href");
$("#ajax-info").load(targetUrl + " .ym-form", function() {
- // Initialise the WYSIWYG editor
- init_tinymce();
-
// Call other custom initialisation functions
// (e.g. if the form as an autocompleter, it has to be initialised again)
if (typeof custom_modal_init != "undefined")