From f77b561f4132adf040185521e2012d793df14004 Mon Sep 17 00:00:00 2001 From: Arthur Araujo Date: Fri, 15 May 2020 17:00:14 -0300 Subject: [PATCH] Removing on off click on calendar init --- js/classes/Calendar.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/js/classes/Calendar.js b/js/classes/Calendar.js index c06170aae..2f402147c 100644 --- a/js/classes/Calendar.js +++ b/js/classes/Calendar.js @@ -48,22 +48,10 @@ class Calendar { _initCalendar() { this._generateTemplate(); - var calendar = this; - $('#punch-button').off('click').on('click', function() { - calendar.punchDate(); - }); - - $('#next-month').off('click').on('click', function() { - calendar.nextMonth(); - }); - - $('#prev-month').off('click').on('click', function() { - calendar.prevMonth(); - }); - - $('#current-month').off('click').on('click', function() { - calendar.goToCurrentDate(); - }); + $('#punch-button').click(() => { this.punchDate(); }); + $('#next-month').click(() => { this.nextMonth(); }); + $('#prev-month').click(() => { this.prevMonth(); }); + $('#current-month').click(() => { this.goToCurrentDate(); }); this._draw(); }