Skip to content

Commit 1f416ba

Browse files
authored
Merge pull request #742 from ValeDale/master
Update jquery.orgchart.js
2 parents 2e687a7 + 804793a commit 1f416ba

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dist/js/jquery.orgchart.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@
277277
},
278278
//
279279
bindPan: function () {
280+
this.unbindPan();
280281
this.$chartContainer.css('overflow', 'hidden');
281282
this.$chart.on('mousedown touchstart', this.panStartHandler);
282283
$(document).on('mouseup touchend', { 'chart': this.$chart }, this.panEndHandler);
@@ -324,6 +325,7 @@
324325
},
325326
//
326327
bindZoom: function () {
328+
this.unbindZoom();
327329
this.$chartContainer.on('wheel', { 'oc': this }, this.zoomWheelHandler);
328330
this.$chartContainer.on('touchstart', { 'oc': this }, this.zoomStartHandler);
329331
$(document).on('touchmove', { 'oc': this }, this.zoomingHandler);
@@ -383,8 +385,8 @@
383385
attachRel: function (data, flags) {
384386
var that = this;
385387
data.relationship = flags + (data.children && data.children.length > 0 ? 1 : 0);
386-
if (this.options?.compact?.constructor === Function && this.options.compact(data)) {
387-
data.compact = true;
388+
if (this.options?.compact?.constructor === Function ) {
389+
data.compact = this.options.compact(data);
388390
}
389391
if (data.children) {
390392
data.children.forEach(function(item) {

0 commit comments

Comments
 (0)