robicch / jQueryGantt

jQuery Gantt editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Just something I noticed.

pokecheater opened this issue · comments

Hello TW-Gantt-Team.

First I want to thank you for this great open source project. Currently we are trying to use it inside an angular application. So in order to make it work I had to do a lot of customizations and there was something I noticed.

Inside the gantt.html file you define the GantMaster Object with the name ge. And ocassionally this global variable is re used inside the GantMaster object inside the prototype functions: manageSaveRequired and checkChanges. Because in angularJS it is not so easy to use global variables I had to customize these two functions. And here its getting confusing to me because why the Gant.html and the gantMaster.js are seperate files but both are using the same global variable? From my understanding a separate file or class should be a closed standalone thing.

So I just removed the ge references inside ganttMaster.js and replaced it with this and then I have bind at the line this.element.on("saveRequired.gantt", this.manageSaveRequired.bind(this));
the GantMaster object itself, so I have access to it inside the callback event function and then there is no need to use the global ge variable.

Hi,
thank you for pointing out this.
It is of course a nasty coding example :-), probably caused by an happy refactoring.
I'll fix and update the code asap

Yeah, this is one of these things that might get wrong during refactoring :). Thx for fixing.