leaflet-rails 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  module Leaflet
2
2
  module Rails
3
- VERSION = "0.6.1"
3
+ VERSION = "0.6.2"
4
4
  end
5
5
  end
@@ -7,7 +7,7 @@
7
7
  var oldL = window.L,
8
8
  L = {};
9
9
 
10
- L.version = '0.6.1';
10
+ L.version = '0.6.2';
11
11
 
12
12
  // define Leaflet for Node module pattern loaders, including Browserify
13
13
  if (typeof module === 'object' && typeof module.exports === 'object') {
@@ -2606,10 +2606,7 @@ L.TileLayer = L.Class.extend({
2606
2606
  var className = 'leaflet-tile-container leaflet-zoom-animated';
2607
2607
 
2608
2608
  this._bgBuffer = L.DomUtil.create('div', className, this._container);
2609
- this._bgBuffer.style.zIndex = 1;
2610
-
2611
2609
  this._tileContainer = L.DomUtil.create('div', className, this._container);
2612
- this._tileContainer.style.zIndex = 2;
2613
2610
 
2614
2611
  } else {
2615
2612
  this._tileContainer = this._container;
@@ -6460,6 +6457,7 @@ L.Draggable = L.Class.extend({
6460
6457
  if (L.Draggable._disabled) { return; }
6461
6458
 
6462
6459
  L.DomUtil.disableImageDrag();
6460
+ L.DomUtil.disableTextSelection();
6463
6461
 
6464
6462
  var first = e.touches ? e.touches[0] : e,
6465
6463
  el = first.target;
@@ -6499,7 +6497,6 @@ L.Draggable = L.Class.extend({
6499
6497
  this._startPos = L.DomUtil.getPosition(this._element).subtract(offset);
6500
6498
 
6501
6499
  if (!L.Browser.touch) {
6502
- L.DomUtil.disableTextSelection();
6503
6500
  L.DomUtil.addClass(document.body, 'leaflet-dragging');
6504
6501
  }
6505
6502
  }
@@ -6519,7 +6516,6 @@ L.Draggable = L.Class.extend({
6519
6516
 
6520
6517
  _onUp: function () {
6521
6518
  if (!L.Browser.touch) {
6522
- L.DomUtil.enableTextSelection();
6523
6519
  L.DomUtil.removeClass(document.body, 'leaflet-dragging');
6524
6520
  }
6525
6521
 
@@ -6530,6 +6526,7 @@ L.Draggable = L.Class.extend({
6530
6526
  }
6531
6527
 
6532
6528
  L.DomUtil.enableImageDrag();
6529
+ L.DomUtil.enableTextSelection();
6533
6530
 
6534
6531
  if (this._moved) {
6535
6532
  // ensure drag is not fired after dragend
@@ -8664,28 +8661,13 @@ L.Map.include(!L.DomUtil.TRANSITION ? {} : {
8664
8661
 
8665
8662
  L.TileLayer.include({
8666
8663
  _animateZoom: function (e) {
8667
- var firstFrame = false;
8668
-
8669
8664
  if (!this._animating) {
8670
8665
  this._animating = true;
8671
- firstFrame = true;
8672
- }
8673
-
8674
- if (firstFrame) {
8675
8666
  this._prepareBgBuffer();
8676
8667
  }
8677
8668
 
8678
- var bg = this._bgBuffer;
8679
-
8680
- if (firstFrame) {
8681
- //prevent bg buffer from clearing right after zoom
8682
- clearTimeout(this._clearBgBufferTimer);
8683
-
8684
- // hack to make sure transform is updated before running animation
8685
- L.Util.falseFn(bg.offsetWidth);
8686
- }
8687
-
8688
- var transform = L.DomUtil.TRANSFORM,
8669
+ var bg = this._bgBuffer,
8670
+ transform = L.DomUtil.TRANSFORM,
8689
8671
  initialTransform = e.delta ? L.DomUtil.getTranslateString(e.delta) : bg.style[transform],
8690
8672
  scaleStr = L.DomUtil.getScaleString(e.scale, e.origin);
8691
8673
 
@@ -8699,9 +8681,7 @@ L.TileLayer.include({
8699
8681
  bg = this._bgBuffer;
8700
8682
 
8701
8683
  front.style.visibility = '';
8702
- front.style.zIndex = 2;
8703
-
8704
- bg.style.zIndex = 1;
8684
+ front.parentNode.appendChild(front); // Bring to fore
8705
8685
 
8706
8686
  // force reflow
8707
8687
  L.Util.falseFn(bg.offsetWidth);
@@ -8745,6 +8725,9 @@ L.TileLayer.include({
8745
8725
  bg = this._bgBuffer = front;
8746
8726
 
8747
8727
  this._stopLoadingImages(bg);
8728
+
8729
+ //prevent bg buffer from clearing right after zoom
8730
+ clearTimeout(this._clearBgBufferTimer);
8748
8731
  },
8749
8732
 
8750
8733
  _getLoadedTilesPercentage: function (container) {
@@ -53,6 +53,10 @@
53
53
  width: 0;
54
54
  height: 0;
55
55
  }
56
+ /* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
57
+ .leaflet-overlay-pane svg {
58
+ -moz-user-select: none;
59
+ }
56
60
 
57
61
  .leaflet-tile-pane { z-index: 2; }
58
62
  .leaflet-objects-pane { z-index: 3; }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leaflet-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: