Skip to content

Commit

Permalink
Click on column header itself also triggers re-order of the column
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Stitz committed Jul 28, 2016
1 parent bb8fe70 commit 19ead89
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,14 @@ export class HeaderRenderer {
var $headers = $base.selectAll('div.' + clazz).data(columns, (d) => d.id);
var $headers_enter = $headers.enter().append('div').attr({
'class': clazz
})
.on('click', (d) => {
if (this.options.manipulative && !d3.event.defaultPrevented && d3.event.currentTarget === d3.event.target) {
d.toggleMySorting();
}
});
var $header_enter_div = $headers_enter.append('div').classed('lu-label', true).on('click', (d) => {
var $header_enter_div = $headers_enter.append('div').classed('lu-label', true)
.on('click', (d) => {
if (this.options.manipulative && !d3.event.defaultPrevented) {
d.toggleMySorting();
}
Expand Down

0 comments on commit 19ead89

Please sign in to comment.