diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js index 5e4fc02b1..fc8a98880 100644 --- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js +++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js @@ -374,12 +374,13 @@ var PMSCalendarController = AbstractController.extend({ this._multi_calendar.on_calendar('hcalOnSavePricelist', function(ev){ self.savePricelist(ev.detail.calendar_obj, ev.detail.pricelist_id, ev.detail.pricelist); }); - this._multi_calendar.on_calendar('hcalOnMouseEnterReservation', function(ev){ + this._multi_calendar.on_calendar('hcalOnClickReservation', function(ev){ + console.log('hcalOnClickReservation'); if (ev.detail.reservationObj) { var tp = self._multi_calendar._reserv_tooltips[ev.detail.reservationObj.id]; var qdict = self._generate_reservation_tooltip_dict(tp); $(ev.detail.reservationDiv).tooltip('destroy').tooltip({ - trigger: 'manual', + trigger: 'click', animation: false, html: true, placement: 'bottom', @@ -408,8 +409,9 @@ var PMSCalendarController = AbstractController.extend({ $content: QWeb.render('HotelCalendar.ConfirmSplitOperation', qdict) }).open(); }); - this._multi_calendar.on_calendar('hcalOnClickReservation', function(ev){ + this._multi_calendar.on_calendar('hcalOnDblClickReservation', function(ev){ //var res_id = ev.detail.reservationObj.getUserData('folio_id'); + console.log('hcalOnDblClickReservation'); $(ev.detail.reservationDiv).tooltip('hide'); self.do_action({ type: 'ir.actions.act_window', @@ -682,7 +684,6 @@ var PMSCalendarController = AbstractController.extend({ }, _generate_reservation_tooltip_dict: function(tp) { - console.log(tp); return { 'folio_name': tp['folio_name'], 'name': tp['name'], diff --git a/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js b/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js index f6937f8fe..cb938b527 100644 --- a/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js +++ b/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js @@ -2067,6 +2067,25 @@ HotelCalendar.prototype = { }; rdiv.addEventListener('mousedown', _funcEvent, false); rdiv.addEventListener('touchstart', _funcEvent, false); + rdiv.addEventListener('click', function(ev){ + $this._dispatchEvent( + 'hcalOnClickReservation', + { + 'event': ev, + 'reservationDiv': this, + 'reservationObj': $this.getReservation(this.dataset.hcalReservationObjId) + }); + }, false); + rdiv.addEventListener('dblclick', function(ev){ + $this._dispatchEvent( + 'hcalOnDblClickReservation', + { + 'event': ev, + 'reservationDiv': this, + 'reservationObj': $this.getReservation(this.dataset.hcalReservationObjId) + }); + }, false); + /* rdiv.addEventListener('mouseenter', function(ev){ $this._dispatchEvent( 'hcalOnMouseEnterReservation', @@ -2076,6 +2095,7 @@ HotelCalendar.prototype = { 'reservationObj': $this.getReservation(this.dataset.hcalReservationObjId) }); }, false); + */ rdiv.addEventListener('mouseleave', function(ev){ $this._dispatchEvent( 'hcalOnMouseLeaveReservation', @@ -2704,13 +2724,15 @@ HotelCalendar.prototype = { } reservDiv.classList.remove('hcal-reservation-invalid'); } else { + /* this._dispatchEvent( - 'hcalOnClickReservation', + 'hcalOnDblClickReservation', { 'event': ev, 'reservationDiv': reservDiv, 'reservationObj': reserv }); + */ } this._reset_action_reservation();