feat: allow readonly

This commit is contained in:
Safwan Samsudeen 2024-04-08 02:09:14 +05:30
parent 0b235d3397
commit bbbf28819b
2 changed files with 3 additions and 1 deletions

View File

@ -152,7 +152,7 @@ export default class Bar {
}
draw_resize_handles() {
if (this.invalid) return;
if (this.invalid || this.gantt.options.readonly) return;
const bar = this.$bar;
const handle_width = 8;

View File

@ -98,6 +98,7 @@ export default class Gantt {
popup_trigger: "click",
custom_popup_html: null,
language: "en",
readonly: false,
};
this.options = Object.assign({}, default_options, options);
for (let [key, value] of Object.entries(options.view_mode_padding)) {
@ -323,6 +324,7 @@ export default class Gantt {
}
bind_events() {
if (this.options.readonly) return
this.bind_grid_click();
this.bind_bar_events();
}