Change ol.Object event name syntax

'changed' to 'change' and '<attribute>_changed' to 'change:<attribute>'.
This commit is contained in:
Frederic Junod
2013-05-07 16:09:19 +02:00
parent 5e5d8e5b17
commit 984002a7ec
10 changed files with 46 additions and 46 deletions

View File

@@ -195,30 +195,30 @@ describe('ol.collection', function() {
});
});
describe('length_changed event', function() {
describe('change:length event', function() {
var collection, cb;
beforeEach(function() {
collection = new ol.Collection([0, 1, 2]);
cb = sinon.spy();
goog.events.listen(collection, 'length_changed', cb);
goog.events.listen(collection, 'change:length', cb);
});
describe('insertAt', function() {
it('triggers length_changed event', function() {
it('triggers change:length event', function() {
collection.insertAt(2, 3);
expect(cb).to.be.called();
});
});
describe('removeAt', function() {
it('triggers length_changed event', function() {
it('triggers change:length event', function() {
collection.removeAt(0);
expect(cb).to.be.called();
});
});
describe('setAt', function() {
it('does not trigger length_changed event', function() {
it('does not trigger change:length event', function() {
collection.setAt(1, 1);
expect(cb).to.not.be.called();
});