Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function(grunt) {
var banner = '/*! Version: <%= pkg.version %>\nDate: <%= grunt.template.today("yyyy-mm-dd") %> */\n';

var banner = '/*! Version: <%= pkg.version %>\nDate: <%= grunt.template.today("yyyy-mm-dd") %> */\n(function (){\n\'use strict\';';
var footer = '\n}());'
require('load-grunt-tasks')(grunt);

grunt.initConfig({
Expand All @@ -9,7 +9,8 @@ module.exports = function(grunt) {
options: {
banner: banner,
preserveComments: 'some',
sourceMap: true
sourceMap: true,
footer: footer
},
dist: {
files: {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@
"leaflet"
]
}
}
},
"browser":"src/leaflet.groupedlayercontrol.js"
}
13 changes: 6 additions & 7 deletions src/leaflet.groupedlayercontrol.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* global L */

// A layer control which provides for layer groupings.
// Author: Ishmael Smyrnow
var L = (typeof require === 'function') ? require('leaflet') : window.L;
L.Control.GroupedLayers = L.Control.extend({

options: {
Expand Down Expand Up @@ -207,7 +206,7 @@ L.Control.GroupedLayers = L.Control.extend({
var label = document.createElement('label'),
input,
checked = this._map.hasLayer(obj.layer),
container;
container, groupRadioName;

if (obj.overlay) {
if (obj.group.exclusive) {
Expand Down Expand Up @@ -246,7 +245,7 @@ L.Control.GroupedLayers = L.Control.extend({

var groupLabel = document.createElement('label');
groupLabel.className = 'leaflet-control-layers-group-label';

if ("" != obj.group.name && !obj.group.exclusive){
// ------ add a group checkbox with an _onInputClickGroup function
if (this.options.groupCheckboxes) {
Expand Down Expand Up @@ -280,10 +279,10 @@ L.Control.GroupedLayers = L.Control.extend({

return label;
},

_onGroupInputClick: function () {
var i, input, obj;

this_legend = this.legend;
this_legend._handlingClick = true;

Expand All @@ -303,7 +302,7 @@ L.Control.GroupedLayers = L.Control.extend({
};
this_legend._handlingClick = false;
},

_onInputClick: function () {
var i, input, obj,
inputs = this._form.getElementsByTagName('input'),
Expand Down