OrgChart icon indicating copy to clipboard operation
OrgChart copied to clipboard

bindZoom() called twice on init

Open fabCampani opened this issue 5 years ago • 2 comments

Following the example at: http://dabeng.github.io/OrgChart/reload-data.html

I need to reload chart with new data when I click a 'refresh' button, calling: oc.init({ 'data': datasource });

With the option: 'zoom': true

oc.init() call bindZoom() every time that oc is initalizated, so the mouse wheel event is raised multiple times, with unespected zoom levels. (It multiplies zoom factor n times) It seems that the same issue exists with the use of function: setOptions()

fabCampani avatar Jan 29 '20 08:01 fabCampani

file : jquery.orgchart.js Solution : Add a call to unbind the zoom in 'bindZoom' function.

L:300 bindZoom: function () { L:301 (new raw) this.unbindZoom();

vobino avatar Oct 12 '20 08:10 vobino

file : jquery.orgchart.js Solution : Add a call to unbind the zoom in 'bindZoom' function.

L:300 bindZoom: function () { L:301 (new raw) this.unbindZoom();

hello, thank you, this solution has worked for me! maybe do a pull request? if you don't want to, I can do it

C-Nedelcu avatar May 25 '23 08:05 C-Nedelcu