reset slider on page load to minimum opacity, fixes #22

This commit is contained in:
Norbert Renner 2015-07-24 14:58:47 +02:00
parent 327c343903
commit 2b6be76cc4
2 changed files with 9 additions and 1 deletions

View file

@ -8,7 +8,12 @@ BR.OpacitySlider = L.Control.extend({
var container = L.DomUtil.create('div', 'leaflet-bar control-slider'),
input = $('<input id="slider" type="text"/>'),
item = localStorage.opacitySliderValue,
value = item ? parseInt(item) : 100;
value = item ? parseInt(item) : 100,
minOpacity = (BR.conf.minOpacity || 0) * 100;
if (value < minOpacity) {
value = minOpacity;
}
var stopClickAfterSlide = function(evt) {
L.DomEvent.stop(evt);