DHTMLX / scheduler

GPL version of JavaScript Event Scheduler
https://dhtmlx.com/docs/products/dhtmlxScheduler/
GNU General Public License v2.0
315 stars 111 forks source link

Javascript error when using custom icons for Next/Previous buttons #23

Closed beauwest closed 8 years ago

beauwest commented 8 years ago

Inside the dhx_cal_prev_button and dhx_cal_next_button buttons, I've implemented custom SVG icons to match our theme. However, SVG className does not have a split() javascript method.

https://github.com/DHTMLX/scheduler/blob/master/codebase/sources/dhtmlxscheduler.js#L2551

This results in an error when clicking the icons, since the event bubbles up from the SVG as the event source. Adding a simple check to make sure the split() method exists would fix this.

var classname = src.className && src.className.split && src.className.split(" ")[0];

Thanks!

beauwest commented 8 years ago

The same is true of

https://github.com/DHTMLX/scheduler/blob/master/codebase/sources/dhtmlxscheduler.js#L2223

var name = (src.className && src.className ? src.className : "").split(" ")[0];
AlexKlimenkov commented 8 years ago

Hi, the issue is already fixed in dev version, this repository will be updated as soon as we publish next minor or major update. Discussed here https://github.com/DHTMLX/scheduler/issues/19

beauwest commented 8 years ago

Great, thank you!