Browse Source

Disable drag selection when multiple selection disabled - #79

pull/104/head
Masayuki Tanaka 11 years ago
parent
commit
1bc841df59
  1. 9
      c3.js
  2. 2
      c3.min.js

9
c3.js

@ -2528,6 +2528,7 @@
if (hasArcType(c3.data.targets)) { return; }
if (! __data_selection_enabled) { return; } // do nothing if not selectable
if (__zoom_enabled && ! zoom.altDomain) { return; } // skip if zoomable because of conflict drag dehavior
if (!__data_selection_multiple) { return; } // skip when single selection becuase drag is used for multiple selection
sx = dragStart[0];
sy = dragStart[1];
@ -2567,12 +2568,8 @@
if (isWithin ^ isIncluded) {
_this.classed(INCLUDED, !isIncluded);
// TODO: included/unincluded callback here
if (__data_selection_multiple) {
_this.classed(SELECTED, !isSelected);
toggle(!isSelected, _this, d, i);
} else {
isSelected ? c3.unselect() : c3.select([d.id], [i], true);
}
_this.classed(SELECTED, !isSelected);
toggle(!isSelected, _this, d, i);
}
});
}

2
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save