From a9677fca555a3abacc1957d67906a882546d9774 Mon Sep 17 00:00:00 2001 From: mourner Date: Tue, 7 Sep 2010 18:20:43 +0300 Subject: [PATCH] removed Options --- spec/suites/core/OptionsSpec.js | 37 --------------------------------- src/core/Options.js | 13 ------------ 2 files changed, 50 deletions(-) delete mode 100644 spec/suites/core/OptionsSpec.js delete mode 100644 src/core/Options.js diff --git a/spec/suites/core/OptionsSpec.js b/spec/suites/core/OptionsSpec.js deleted file mode 100644 index 925e5958..00000000 --- a/spec/suites/core/OptionsSpec.js +++ /dev/null @@ -1,37 +0,0 @@ -describe('Options', function() { - var Klass; - - beforeEach(function() { - Klass = L.Class.extend({ - options: { - foo1: 1, - foo2: 2 - }, - - includes: [L.Mixin.Options] - }); - }); - - describe('#setOptions', function() { - it('should set the given options, overwriting the default ones', function() { - var a = new Klass(); - - expect(a.options).toEqual({foo1: 1, foo2: 2}); - - a.setOptions({foo2: 3, foo3: 4}); - - expect(a.options).toEqual({foo1: 1, foo2: 3, foo3: 4}); - }); - - it('should fire optionschange event if Options module is availalbe', function() { - Klass.include(L.Mixin.Events); - var a = new Klass(), - spy = jasmine.createSpy('optionschange handler'); - - a.on('optionschange', spy); - a.setOptions({foo1: 3}); - - expect(spy).toHaveBeenCalled(); - }); - }); -}); \ No newline at end of file diff --git a/src/core/Options.js b/src/core/Options.js deleted file mode 100644 index d8edf820..00000000 --- a/src/core/Options.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - * L.Mixin.Options adds a small shortcut for options handling - */ - -L.Mixin.Options = { - setOptions: function(/*Object*/ options) { - this.options = L.Util.extend(this.options || {}, options); - - if (this.fireEvent) { - this.fireEvent('optionschange'); - } - } -}; \ No newline at end of file