Reset cursor when translate interaction is removed or deactivated
This commit is contained in:
@@ -233,6 +233,50 @@ describe('ol.interaction.Translate', function() {
|
||||
expect(element.style.cursor).to.eql('pointer');
|
||||
});
|
||||
|
||||
it('resets css cursor when interaction is deactivated while pointer is on feature', function() {
|
||||
simulateEvent('pointermove', 10, 20);
|
||||
expect(element.style.cursor).to.match(/grab$/);
|
||||
|
||||
translate.setActive(false);
|
||||
|
||||
simulateEvent('pointermove', 0, 0);
|
||||
expect(element.style.cursor).to.eql('');
|
||||
});
|
||||
|
||||
it('resets css cursor to existing cursor when interaction is deactivated while pointer is on feature', function() {
|
||||
element.style.cursor = 'pointer';
|
||||
|
||||
simulateEvent('pointermove', 10, 20);
|
||||
expect(element.style.cursor).to.match(/grab$/);
|
||||
|
||||
translate.setActive(false);
|
||||
|
||||
simulateEvent('pointermove', 0, 0);
|
||||
expect(element.style.cursor).to.eql('pointer');
|
||||
});
|
||||
|
||||
it('resets css cursor interaction is removed while pointer is on feature', function() {
|
||||
simulateEvent('pointermove', 10, 20);
|
||||
expect(element.style.cursor).to.match(/grab$/);
|
||||
|
||||
map.removeInteraction(translate);
|
||||
|
||||
simulateEvent('pointermove', 0, 0);
|
||||
expect(element.style.cursor).to.eql('');
|
||||
});
|
||||
|
||||
it('resets css cursor to existing cursor interaction is removed while pointer is on feature', function() {
|
||||
element.style.cursor = 'pointer';
|
||||
|
||||
simulateEvent('pointermove', 10, 20);
|
||||
expect(element.style.cursor).to.match(/grab$/);
|
||||
|
||||
map.removeInteraction(translate);
|
||||
|
||||
simulateEvent('pointermove', 0, 0);
|
||||
expect(element.style.cursor).to.eql('pointer');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user