Skip to content

Commit

Permalink
selection semantics improved
Browse files Browse the repository at this point in the history
  • Loading branch information
stevewirts committed Oct 12, 2015
1 parent 1058584 commit 6494c35
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
39 changes: 20 additions & 19 deletions examples/bclys/fin-hypergrid.dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -13906,7 +13906,7 @@
isRightClick: this.isRightClick(e)
}
}));
//console.log('dblclick', this.currentKeys);
console.log('dblclick', this.currentKeys);
},

getCharMap: function() {
Expand Down Expand Up @@ -16044,7 +16044,7 @@
var visibleColumns = this.getVisibleColumns();
var visibleRows = this.getVisibleRows();
var lastVisibleColumn = visibleColumns[visibleColumns.length - 1];
var lastVisibleRow = this.visibleRows[this.visibleRows.length - 1];
var lastVisibleRow = visibleRows[visibleRows.length - 1];

var extent = selection.extent;

Expand Down Expand Up @@ -16982,7 +16982,6 @@
},
setLastSelectionType: function(type) {
this.lastSelectionType = type;
console.log('selection type', type);
},
/**
* @function
Expand Down Expand Up @@ -23401,6 +23400,7 @@
*/
rectangles: {},

dragArmed: false,
/**
* @function
* @instance
Expand All @@ -23424,8 +23424,9 @@
handleMouseUp: function(grid, event) {
if (this.dragging) {
this.dragging = false;
this.dragArmed = false;
grid.fireSyntheticRowSelectionChangedEvent();
}
} else
if (this.next) {
this.next.handleMouseUp(grid, event);
}
Expand Down Expand Up @@ -23468,7 +23469,7 @@

var primEvent = event.primitiveEvent;
var keys = primEvent.detail.keys;
this.dragging = true;
this.dragArmed = true;
this.extendSelection(grid, dCell, keys);
}
},
Expand All @@ -23484,12 +23485,12 @@
handleMouseDrag: function(grid, event) {
var isRightClick = event.primitiveEvent.detail.isRightClick;

if (!grid.isRowSelection() || isRightClick || !this.dragging) {
if (!this.dragArmed || !grid.isRowSelection() || isRightClick) {
if (this.next) {
this.next.handleMouseDrag(grid, event);
}
} else {

this.dragging = true;
var numFixedRows = grid.getFixedRowCount();

var cell = event.gridCell;
Expand Down Expand Up @@ -25913,9 +25914,9 @@
this.setNextFeature(document.createElement('fin-hypergrid-feature-column-resizing'));
this.setNextFeature(document.createElement('fin-hypergrid-feature-row-resizing'));
this.setNextFeature(document.createElement('fin-hypergrid-feature-filters'));
this.setNextFeature(document.createElement('fin-hypergrid-feature-cell-selection'));
this.setNextFeature(document.createElement('fin-hypergrid-feature-row-selection'));
this.setNextFeature(document.createElement('fin-hypergrid-feature-column-selection'));
this.setNextFeature(document.createElement('fin-hypergrid-feature-cell-selection'));
this.setNextFeature(document.createElement('fin-hypergrid-feature-column-moving'));
this.setNextFeature(document.createElement('fin-hypergrid-feature-column-sorting'));
this.setNextFeature(document.createElement('fin-hypergrid-feature-thumbwheel-scrolling'));
Expand Down Expand Up @@ -36167,17 +36168,17 @@
*
*/
fireSyntheticRowSelectionChangedEvent: function() {
this.selectionChanged();
// var selectedRows = this.getSelectedRows();
// var selectionEvent = new CustomEvent('fin-row-selection-changed', {
// detail: {
// rowContext: this.getRowContextFunction(selectedRows),
// rows: selectedRows,
// columns: this.getSelectedColumns(),
// selections: this.getSelectionModel().getSelections()
// }
// });
// this.canvas.dispatchEvent(selectionEvent);
// this.selectionChanged();
var selectedRows = this.getSelectedRows();
var selectionEvent = new CustomEvent('fin-row-selection-changed', {
detail: {
rowContext: this.getRowContextFunction(selectedRows),
rows: selectedRows,
columns: this.getSelectedColumns(),
selections: this.getSelectionModel().getSelections()
}
});
this.canvas.dispatchEvent(selectionEvent);
},

/**
Expand Down
Loading

0 comments on commit 6494c35

Please sign in to comment.