Skip to content

Commit

Permalink
call dirrectly onRowMouseDown instance of fire itemmousedown event to…
Browse files Browse the repository at this point in the history
… make tests working on ie
  • Loading branch information
Stéphane Brunner committed May 11, 2012
1 parent 57ef11a commit 27d523a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/selection/FeatureModel.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
shiftKey: false,
ctrlKey: false
};
grid.getView().fireEvent("itemmousedown", grid, store.getAt(0), null, 0, e);
sm.onRowMouseDown(grid, store.getAt(0), null, 0, e);
t.ok(OpenLayers.Util.indexOf(layer.selectedFeatures,
features[0]) > -1,
"click on row 0 selects feature 0");
Expand All @@ -193,13 +193,13 @@
shiftKey: false,
ctrlKey: true
};
grid.getView().fireEvent("itemmousedown", grid, store.getAt(0), null, 0, e);
sm.onRowMouseDown(grid, store.getAt(0), null, 0, e);
t.ok(OpenLayers.Util.indexOf(layer.selectedFeatures,
features[0]) > -1, // with extjs 4 the line still be selected
"click on row 0 deselects feature 0");

// simulate a mousedown on the second row
grid.getView().fireEvent("itemmousedown", grid, store.getAt(1), null, 1, e);
sm.onRowMouseDown(grid, store.getAt(1), null, 1, e);
t.ok(OpenLayers.Util.indexOf(layer.selectedFeatures,
features[1]) > -1,
"click on row 1 selects feature 1");
Expand Down Expand Up @@ -299,7 +299,7 @@
shiftKey: false,
ctrlKey: false
};
grid.getView().fireEvent("itemmousedown", grid, store.getAt(0), null, 0, e);
sm.onRowMouseDown(grid, store.getAt(0), null, 0, e);
t.ok(OpenLayers.Util.indexOf(layer.selectedFeatures,
features[0]) < 0,
"click on row 0 does not select feature 0");
Expand All @@ -322,7 +322,7 @@
shiftKey: false,
ctrlKey: false
};
grid.getView().fireEvent("itemmousedown", grid, store.getAt(1), null, 1, e);
sm.onRowMouseDown(grid, store.getAt(1), null, 1, e);
t.ok(OpenLayers.Util.indexOf(layer.selectedFeatures,
features[1]) > -1,
"click on row 1 selects feature 1");
Expand All @@ -347,7 +347,7 @@
shiftKey: false,
ctrlKey: false
};
grid.getView().fireEvent("itemmousedown", grid, store.getAt(0), null, 0, e);
sm.onRowMouseDown(grid, store.getAt(0), null, 0, e);
t.ok(OpenLayers.Util.indexOf(layer.selectedFeatures,
features[0]) < 0,
"click on row 0 does not select feature 0");
Expand All @@ -374,7 +374,7 @@
shiftKey: false,
ctrlKey: false
};
grid.getView().fireEvent("itemmousedown", grid, store.getAt(1), null, 1, e);
sm.onRowMouseDown(grid, store.getAt(1), null, 1, e);
t.ok(OpenLayers.Util.indexOf(layer.selectedFeatures,
features[1]) > -1,
"click on row 1 selects feature 1");
Expand Down Expand Up @@ -457,7 +457,7 @@
shiftKey: false,
ctrlKey: false
};
grid.getView().fireEvent("itemmousedown", grid, store.getAt(0), null, 0, e);
sm.onRowMouseDown(grid, store.getAt(0), null, 0, e);

t.eq(map.getCenter().toString(), "lon=10,lat=10", "Map recentered to lon=10,lat=10 on selection of one feature");
t.eq(map.getZoom(), 0, "Map' s zoom has not changed because feature is visible on this zoom level");
Expand All @@ -475,7 +475,7 @@
shiftKey: false,
ctrlKey: true
};
grid.getView().fireEvent("itemmousedown", grid, store.getAt(1), null, 1, e);
sm.onRowMouseDown(grid, store.getAt(1), null, 1, e);

t.eq(map.getCenter().toString(), "lon=6,lat=6", "Map recentered to lon=6,lat=6 to make multiple selected features visible");
t.eq(map.getZoom(), 4, "Map' s zoom has changed in order to make multiple selected features visible");
Expand Down

0 comments on commit 27d523a

Please sign in to comment.