From a0d4917ac413cff938b7607bf8e36a64622257ef Mon Sep 17 00:00:00 2001 From: 0livd Date: Sun, 20 Aug 2017 12:22:47 +0200 Subject: [PATCH] Fix misplaced datepicker configuration (#258) Bootstrap-datepicker is only included in the list_bills template but its configuration was living in the layout template, leading to a javascript error on every page except list_bills. Fixes #256 --- ihatemoney/templates/layout.html | 7 ------- ihatemoney/templates/list_bills.html | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ihatemoney/templates/layout.html b/ihatemoney/templates/layout.html index 6ecff413..76ae8903 100644 --- a/ihatemoney/templates/layout.html +++ b/ihatemoney/templates/layout.html @@ -21,13 +21,6 @@ }); }, 4000); - $('.datepicker').datepicker({ - format: 'yyyy-mm-dd', - weekStart: 1, - autoclose: true, - language: '{{ g.lang }}' - }); - $('.dropdown-toggle').dropdown(); {% block js %}{% endblock %} diff --git a/ihatemoney/templates/list_bills.html b/ihatemoney/templates/list_bills.html index 4029bc95..13866369 100644 --- a/ihatemoney/templates/list_bills.html +++ b/ihatemoney/templates/list_bills.html @@ -8,6 +8,13 @@ {% block js %} {% if add_bill %} $('#new-bill').click(); {% endif %} + $('.datepicker').datepicker({ + format: 'yyyy-mm-dd', + weekStart: 1, + autoclose: true, + language: '{{ g.lang }}' + }); + // Hide all members actions $('.action').each(function(){ $(this).hide();