Self hosted FLOSS fitness/workout, nutrition and weight tracker
Make the datepicker work on the modal dialogs on the weight application
Roland Geider3d2b5b788c5b
diff --git a/manager/static/js/workout-manager.js b/manager/static/js/workout-manager.jsindex 7cd68b44a..4804b1af9 100644--- a/manager/static/js/workout-manager.js+++ b/manager/static/js/workout-manager.js@@ -239,7 +239,12 @@ function scatterplot_modal_dialog(id)$("#ajax-info").load(targetUrl + " .ym-form", function() {// Open the dialog$("#ajax-info").dialog("open");++ // Initialise the datepicker for the modal dialog+ init_weight_datepicker();});++}function init_ingredient_autocompleter()@@ -331,3 +336,8 @@ function init_edit_set()}});}++function init_weight_datepicker()+{+ $( "#id_creation_date" ).datepicker({ dateFormat: "dd.mm.yy" });+}diff --git a/weight/templates/edit.html b/weight/templates/edit.htmlindex 646c859e6..5dc731e3a 100644--- a/weight/templates/edit.html+++ b/weight/templates/edit.html@@ -8,9 +8,10 @@{% block header %}<script src="{% static "js/jquery-ui.js" %}"></script>+<script src="{% static 'js/workout-manager.js' %}"></script><script>- $(function() {- $( "#id_creation_date" ).datepicker({ dateFormat: "dd.mm.yy" });+$(document).ready(function () {+ init_weight_datepicker();});</script>{% endblock %}diff --git a/weight/templates/weight_overview.html b/weight/templates/weight_overview.htmlindex 7a6a47c3a..9e028e631 100644--- a/weight/templates/weight_overview.html+++ b/weight/templates/weight_overview.html@@ -19,6 +19,12 @@<script type="text/javascript">++// Initialise the datepicker for the modal dialog+function custom_modal_init()+{+ init_weight_datepicker();+}// Simple helper function that simply returns the y component of an entryfunction y_value(d) { return d.y; }@@ -111,7 +117,6 @@ $('circle').click(function(e) {entry_id = $(this).attr('id').match(/\d+/);scatterplot_modal_dialog(entry_id);});-});</script>{% endblock %}