Add feature to change popup trigger event (#77)
* Add change-popup-mode * Add feature to change popup trigger event * Remove example of change_popup_mode from index * Revert back to the original build files * Make changes asked in review * Remove default to click from bind event as default already set * code formatting
This commit is contained in:
parent
98f38e1684
commit
0c39cc9b4e
@ -76,7 +76,6 @@
|
|||||||
custom_class: 'bar-milestone'
|
custom_class: 'bar-milestone'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
var gantt_chart = new Gantt(".gantt-target", tasks, {
|
var gantt_chart = new Gantt(".gantt-target", tasks, {
|
||||||
on_click: function (task) {
|
on_click: function (task) {
|
||||||
console.log(task);
|
console.log(task);
|
||||||
|
|||||||
@ -175,7 +175,7 @@ export default class Bar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setup_click_event() {
|
setup_click_event() {
|
||||||
$.on(this.group, 'focus click', e => {
|
$.on(this.group, 'focus ' + this.gantt.options.popup_trigger, e => {
|
||||||
if (this.action_completed) {
|
if (this.action_completed) {
|
||||||
// just finished a move action, wait for a few seconds
|
// just finished a move action, wait for a few seconds
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -54,6 +54,7 @@ export default class Gantt {
|
|||||||
padding: 18,
|
padding: 18,
|
||||||
view_mode: 'Day',
|
view_mode: 'Day',
|
||||||
date_format: 'YYYY-MM-DD',
|
date_format: 'YYYY-MM-DD',
|
||||||
|
popup_trigger: 'click',
|
||||||
custom_popup_html: null
|
custom_popup_html: null
|
||||||
};
|
};
|
||||||
this.options = Object.assign({}, default_options, options);
|
this.options = Object.assign({}, default_options, options);
|
||||||
@ -571,7 +572,7 @@ export default class Gantt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bind_grid_click() {
|
bind_grid_click() {
|
||||||
$.on(this.$svg, 'click', '.grid-row, .grid-header', () => {
|
$.on(this.$svg, this.options.popup_trigger, '.grid-row, .grid-header', () => {
|
||||||
this.unselect_all();
|
this.unselect_all();
|
||||||
this.hide_popup();
|
this.hide_popup();
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user