Code coverage report for src/Toolbar.Control.js

Statements: 92.86% (13 / 14)      Branches: 50% (1 / 2)      Functions: 100% (5 / 5)      Lines: 100% (13 / 13)      Ignored: none     

All files » src/ » Toolbar.Control.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361           4   4       2   2   2       1 1 1       1   2       1 1    
L.Toolbar.Control = L.Toolbar.extend({
	statics: {
		baseClass: 'leaflet-control-toolbar ' + L.Toolbar.baseClass
	},
 
	initialize: function(options) {
		L.Toolbar.prototype.initialize.call(this, options);
 
		this._control = new L.Control.Toolbar(this.options);
	},
 
	onAdd: function(map) {
		this._control.addTo(map);
 
		L.Toolbar.prototype.onAdd.call(this, map);
 
		this.appendToContainer(this._control.getContainer());
	},
 
	onRemove: function(map) {
		L.Toolbar.prototype.onRemove.call(this, map);
		Iif (this._control.remove) {this._control.remove();}  // Leaflet 1.0
		else {this._control.removeFrom(map);}
	}
});
 
L.Control.Toolbar = L.Control.extend({
	onAdd: function() {
		return L.DomUtil.create('div', '');
	}
});
 
L.toolbar.control = function(options) {
    return new L.Toolbar.Control(options);
};