mirror of https://github.com/OCA/web.git
[FIX] web_timeline: calling of add_events
[FIX] web_timeline: calling of add_eventspull/1087/head
parent
086080e0da
commit
9855f42cfd
|
@ -15,7 +15,13 @@ odoo.define('web_timeline.TimelineRenderer', function (require) {
|
||||||
|
|
||||||
var TimelineRenderer = AbstractRenderer.extend({
|
var TimelineRenderer = AbstractRenderer.extend({
|
||||||
template: "TimelineView",
|
template: "TimelineView",
|
||||||
|
|
||||||
events: _.extend({}, AbstractRenderer.prototype.events, {
|
events: _.extend({}, AbstractRenderer.prototype.events, {
|
||||||
|
'click .oe_timeline_button_today': '_onTodayClicked',
|
||||||
|
'click .oe_timeline_button_scale_day': '_onScaleDayClicked',
|
||||||
|
'click .oe_timeline_button_scale_week': '_onScaleWeekClicked',
|
||||||
|
'click .oe_timeline_button_scale_month': '_onScaleMonthClicked',
|
||||||
|
'click .oe_timeline_button_scale_year': '_onScaleYearClicked',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,7 +81,6 @@ odoo.define('web_timeline.TimelineRenderer', function (require) {
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
_render: function () {
|
_render: function () {
|
||||||
this.add_events();
|
|
||||||
var self = this;
|
var self = this;
|
||||||
return $.when().then(function () {
|
return $.when().then(function () {
|
||||||
// Prevent Double Rendering on Updates
|
// Prevent Double Rendering on Updates
|
||||||
|
@ -86,30 +91,6 @@ odoo.define('web_timeline.TimelineRenderer', function (require) {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Binds events to buttons.
|
|
||||||
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
add_events: function () {
|
|
||||||
var self = this;
|
|
||||||
this.$(".oe_timeline_button_today").click(function() {
|
|
||||||
self._onTodayClicked();
|
|
||||||
});
|
|
||||||
this.$(".oe_timeline_button_scale_day").click(function() {
|
|
||||||
self._onScaleDayClicked();
|
|
||||||
});
|
|
||||||
this.$(".oe_timeline_button_scale_week").click(function() {
|
|
||||||
self._onScaleWeekClicked();
|
|
||||||
});
|
|
||||||
this.$(".oe_timeline_button_scale_month").click(function() {
|
|
||||||
self._onScaleMonthClicked();
|
|
||||||
});
|
|
||||||
this.$(".oe_timeline_button_scale_year").click(function() {
|
|
||||||
self._onScaleYearClicked();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the timeline window to today (day).
|
* Set the timeline window to today (day).
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue