leaflet-sidebar-rails 0.0.3 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c6256aebac11aed73786c449853aa03ec994033
4
- data.tar.gz: 8d2ee2f3cf43c07830fc37df442352b2660d5597
3
+ metadata.gz: a404f563ee5dc6c4cf4af85ca9cd1ee39cab95ce
4
+ data.tar.gz: ff0953cf6e72e9518ed8ce9385dc239e61072ec4
5
5
  SHA512:
6
- metadata.gz: 364f841200cb11decda2b3665cc41abebeb0bf806fae3ee81c144e48f11749ca7f9d6f8266533389f2b98edac1030618c1b7c5e1864eb452386ba664d53ca4eb
7
- data.tar.gz: 5fe13343f87055a1693bf22f34106ef234085efb1e90da0b986b0505b5d35d70ece5ace649c623198feafb75c70ed5712cd2157eb97d6a45ab968d23a1b03f3f
6
+ metadata.gz: 815ecdb6d98f3ac4f7f5ef8c72d48e1e4124e884f43d54c95fd7a869d6640f78f495cbb26544c6a840210204930db4dada096c60d6c7c6ff57d6913a77cc080a
7
+ data.tar.gz: 78a18dddf4ba29afdac940a8dd7b805f7979d3ae6b212c1ed06fef37cc3219f8befc3d7a76e52e632587ebf762cb8c96b072630bf03a302695a7ca88a3bc2d17
data/.gitignore CHANGED
@@ -19,3 +19,4 @@ pickle-email-*.html
19
19
  .project
20
20
  config/initializers/secret_token.rb
21
21
  .DS_Store
22
+ /Gemfile.lock
@@ -0,0 +1,7 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ Bundler::GemHelper.install_tasks
@@ -16,5 +16,6 @@ Gem::Specification.new do |s|
16
16
  s.files = `git ls-files`.split("\n")
17
17
  # s.files = Dir["{app,config,db,lib,vendor}/**/*", "LICENSE.txt", "LICENSE-leaflet-sidebar.txt", "Rakefile", "README.md"]
18
18
  s.require_paths = ["lib"]
19
+ s.add_development_dependency 'rake'
19
20
 
20
21
  end
@@ -1,7 +1,7 @@
1
1
  module Leaflet
2
2
  module Sidebar
3
3
  module Rails
4
- VERSION = "0.0.3"
4
+ VERSION = '0.1.9'
5
5
  end
6
6
  end
7
7
  end
@@ -60,11 +60,13 @@ L.Control.Sidebar = L.Control.extend({
60
60
 
61
61
  // Make sure we don't drag the map when we interact with the content
62
62
  var stop = L.DomEvent.stopPropagation;
63
+ var fakeStop = L.DomEvent._fakeStop || stop;
63
64
  L.DomEvent
64
- .on(content, 'click', stop)
65
+ .on(content, 'contextmenu', stop)
66
+ .on(content, 'click', fakeStop)
65
67
  .on(content, 'mousedown', stop)
66
68
  .on(content, 'touchstart', stop)
67
- .on(content, 'dblclick', stop)
69
+ .on(content, 'dblclick', fakeStop)
68
70
  .on(content, 'mousewheel', stop)
69
71
  .on(content, 'MozMousePixelScroll', stop);
70
72
 
@@ -75,22 +77,25 @@ L.Control.Sidebar = L.Control.extend({
75
77
  //if the control is visible, hide it before removing it.
76
78
  this.hide();
77
79
 
80
+ var container = this._container;
78
81
  var content = this._contentContainer;
79
82
 
80
83
  // Remove sidebar container from controls container
81
84
  var controlContainer = map._controlContainer;
82
- controlContainer.removeChild(this._container);
85
+ controlContainer.removeChild(container);
83
86
 
84
87
  //disassociate the map object
85
88
  this._map = null;
86
89
 
87
90
  // Unregister events to prevent memory leak
88
91
  var stop = L.DomEvent.stopPropagation;
92
+ var fakeStop = L.DomEvent._fakeStop || stop;
89
93
  L.DomEvent
90
- .off(content, 'click', stop)
94
+ .off(content, 'contextmenu', stop)
95
+ .off(content, 'click', fakeStop)
91
96
  .off(content, 'mousedown', stop)
92
97
  .off(content, 'touchstart', stop)
93
- .off(content, 'dblclick', stop)
98
+ .off(content, 'dblclick', fakeStop)
94
99
  .off(content, 'mousewheel', stop)
95
100
  .off(content, 'MozMousePixelScroll', stop);
96
101
 
@@ -177,4 +182,4 @@ L.Control.Sidebar = L.Control.extend({
177
182
 
178
183
  L.control.sidebar = function (placeholder, options) {
179
184
  return new L.Control.Sidebar(placeholder, options);
180
- };
185
+ };
@@ -0,0 +1,157 @@
1
+ $threshold-lg: 1200px;
2
+ $threshold-md: 992px;
3
+ $threshold-sm: 768px;
4
+
5
+ $width-lg: 460px;
6
+ $width-md: 390px;
7
+ $width-sm: 305px;
8
+ $width-xs: 100%;
9
+
10
+ $transition-duration: 0.5s;
11
+
12
+ @mixin border-radius($border-radius) {
13
+ -webkit-border-radius: $border-radius;
14
+ border-radius: $border-radius;
15
+ }
16
+
17
+ @mixin box-sizing($box-sizing) {
18
+ -webkit-box-sizing: $box-sizing;
19
+ -moz-box-sizing: $box-sizing;
20
+ box-sizing: $box-sizing;
21
+ }
22
+
23
+ @mixin widths($width) {
24
+ width: $width;
25
+
26
+ &.left.visible ~ .leaflet-left {
27
+ left: $width;
28
+ }
29
+
30
+ &.right.visible ~ .leaflet-right {
31
+ right: $width;
32
+ }
33
+ }
34
+
35
+ .leaflet-sidebar {
36
+ position: absolute;
37
+ height: 100%;
38
+
39
+ @include box-sizing(border-box);
40
+ padding: 10px;
41
+
42
+ z-index: 2000;
43
+
44
+ &.left {
45
+ left: -500px;
46
+ transition: left $transition-duration, width $transition-duration;
47
+
48
+ padding-right: 0;
49
+
50
+ &.visible {
51
+ left: 0;
52
+ }
53
+ }
54
+
55
+ &.right {
56
+ right: -500px;
57
+ transition: right $transition-duration, width $transition-duration;
58
+
59
+ padding-left: 0;
60
+
61
+ &.visible {
62
+ right: 0;
63
+ }
64
+ }
65
+
66
+ & > .leaflet-control {
67
+ height: 100%;
68
+ width: 100%;
69
+
70
+ overflow: auto;
71
+ -webkit-overflow-scrolling: touch;
72
+
73
+ @include box-sizing(border-box);
74
+ padding: 8px 24px;
75
+
76
+ font-size: 1.1em;
77
+
78
+ background: white;
79
+ box-shadow: 0 1px 7px rgba(0,0,0,0.65);
80
+ @include border-radius(4px);
81
+
82
+ .leaflet-touch & {
83
+ box-shadow: none;
84
+ border: 2px solid rgba(0,0,0,0.2);
85
+ background-clip: padding-box;
86
+ }
87
+ }
88
+
89
+ @media(max-width:$threshold-sm - 1px) {
90
+ @include widths($width-xs);
91
+
92
+ padding: 0;
93
+
94
+ &.left {
95
+ left: -$width-xs;
96
+
97
+ &.visible {
98
+ left: 0;
99
+ }
100
+ }
101
+
102
+ &.right {
103
+ right: -$width-xs;
104
+
105
+ &.visible {
106
+ right: 0;
107
+ }
108
+ }
109
+
110
+ & > .leaflet-control {
111
+ box-shadow: none;
112
+ @include border-radius(0);
113
+
114
+ .leaflet-touch & {
115
+ border: 0;
116
+ }
117
+ }
118
+ }
119
+
120
+ @media(min-width:$threshold-sm) and (max-width:$threshold-md - 1px) {
121
+ @include widths($width-sm);
122
+ }
123
+
124
+ @media(min-width:$threshold-md) and (max-width:$threshold-lg - 1px) {
125
+ @include widths($width-md);
126
+ }
127
+
128
+ @media(min-width:$threshold-lg) {
129
+ @include widths($width-lg);
130
+ }
131
+
132
+ .close {
133
+ position: absolute;
134
+ right: 20px;
135
+ top: 20px;
136
+ width: 31px;
137
+ height: 31px;
138
+
139
+ color: #333;
140
+ font-size: 25pt;
141
+ line-height: 1em;
142
+ text-align: center;
143
+ background: white;
144
+ @include border-radius(16px);
145
+ cursor: pointer;
146
+
147
+ z-index: 8;
148
+ }
149
+ }
150
+
151
+ .leaflet-left {
152
+ transition: left $transition-duration;
153
+ }
154
+
155
+ .leaflet-right {
156
+ transition: right $transition-duration;
157
+ }
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leaflet-sidebar-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Reed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-25 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2016-06-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: A responsive sidebar for leaflet maps
14
28
  email:
15
29
  - phillipjreed@gmail.com
@@ -22,12 +36,13 @@ files:
22
36
  - LICENSE-leaflet-sidebar.txt
23
37
  - LICENSE.txt
24
38
  - README.md
39
+ - Rakefile
25
40
  - leaflet-sidebar-rails-0.0.1.gem
26
41
  - leaflet-sidebar-rails.gemspec
27
42
  - lib/leaflet-sidebar-rails.rb
28
43
  - lib/leaflet-sidebar-rails/version.rb
29
44
  - vendor/assets/javascripts/L.Control.Sidebar.js
30
- - vendor/assets/stylesheets/L.Control.Sidebar.css
45
+ - vendor/assets/stylesheets/L.Control.Sidebar.scss
31
46
  homepage: https://github.com/mejackreed/leaflet-sidebar-rails
32
47
  licenses: []
33
48
  metadata: {}
@@ -47,9 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
62
  version: '0'
48
63
  requirements: []
49
64
  rubyforge_project:
50
- rubygems_version: 2.2.0
65
+ rubygems_version: 2.4.5.1
51
66
  signing_key:
52
67
  specification_version: 4
53
68
  summary: Rails plugin for Leaflet-Sidebar plugin
54
69
  test_files: []
55
- has_rdoc:
@@ -1,169 +0,0 @@
1
- .leaflet-sidebar {
2
- position: absolute;
3
- height: 100%;
4
-
5
- -webkit-box-sizing: border-box;
6
- -moz-box-sizing: border-box;
7
- box-sizing: border-box;
8
- padding: 10px;
9
-
10
- z-index: 2000;
11
- }
12
-
13
- .leaflet-sidebar.left {
14
- left: -500px;
15
- transition: left 0.5s, width 0.5s;
16
-
17
- padding-right: 0;
18
- }
19
-
20
- .leaflet-sidebar.right {
21
- right: -500px;
22
- transition: right 0.5s, width 0.5s;
23
-
24
- padding-left: 0;
25
- }
26
-
27
- .leaflet-sidebar.left.visible {
28
- left: 0;
29
- }
30
-
31
- .leaflet-sidebar.right.visible {
32
- right: 0;
33
- }
34
-
35
- .leaflet-left {
36
- transition: left 0.5s;
37
- }
38
-
39
- .leaflet-right {
40
- transition: right 0.5s;
41
- }
42
-
43
- .leaflet-sidebar > .leaflet-control {
44
- height: 100%;
45
- width: 100%;
46
-
47
- overflow: auto;
48
- -webkit-overflow-scrolling: touch;
49
-
50
- -webkit-box-sizing: border-box;
51
- -moz-box-sizing: border-box;
52
- box-sizing: border-box;
53
- padding: 8px 24px;
54
-
55
- font-size: 1.1em;
56
-
57
- background: white;
58
- box-shadow: 0 1px 7px rgba(0,0,0,0.65);
59
- -webkit-border-radius: 4px;
60
- border-radius: 4px;
61
- }
62
-
63
- .leaflet-touch .leaflet-sidebar > .leaflet-control {
64
- box-shadow: none;
65
- border: 2px solid rgba(0,0,0,0.2);
66
- background-clip: padding-box;
67
- }
68
-
69
- @media(max-width:767px){
70
- .leaflet-sidebar {
71
- width: 100%;
72
- padding: 0;
73
- }
74
-
75
- .leaflet-sidebar.left {
76
- left: -100%;
77
- }
78
-
79
- .leaflet-sidebar.right {
80
- right: -100%;
81
- }
82
-
83
- .leaflet-sidebar.left.visible {
84
- left: 0;
85
- }
86
-
87
- .leaflet-sidebar.right.visible {
88
- right: 0;
89
- }
90
-
91
- .leaflet-sidebar > .leaflet-control {
92
- box-shadow: none;
93
- -webkit-border-radius: 0;
94
- border-radius: 0;
95
- }
96
-
97
- .leaflet-sidebar.left.visible ~ .leaflet-left {
98
- left: 100%;
99
- }
100
-
101
- .leaflet-sidebar.right.visible ~ .leaflet-right {
102
- right: 100%;
103
- }
104
-
105
- .leaflet-touch .leaflet-sidebar > .leaflet-control {
106
- border: 0;
107
- }
108
- }
109
-
110
- @media(min-width:768px) and (max-width:991px){
111
- .leaflet-sidebar {
112
- width: 305px;
113
- }
114
-
115
- .leaflet-sidebar.left.visible ~ .leaflet-left {
116
- left: 305px;
117
- }
118
-
119
- .leaflet-sidebar.right.visible ~ .leaflet-right {
120
- right: 305px;
121
- }
122
- }
123
-
124
- @media(min-width:992px) and (max-width:1199px){
125
- .leaflet-sidebar {
126
- width: 390px;
127
- }
128
-
129
- .leaflet-sidebar.left.visible ~ .leaflet-left {
130
- left: 390px;
131
- }
132
-
133
- .leaflet-sidebar.right.visible ~ .leaflet-right {
134
- right: 390px;
135
- }
136
- }
137
-
138
- @media(min-width:1200px){
139
- .leaflet-sidebar {
140
- width: 460px;
141
- }
142
-
143
- .leaflet-sidebar.left.visible ~ .leaflet-left {
144
- left: 460px;
145
- }
146
-
147
- .leaflet-sidebar.right.visible ~ .leaflet-right {
148
- right: 460px;
149
- }
150
- }
151
-
152
- .leaflet-sidebar .close {
153
- position: absolute;
154
- right: 20px;
155
- top: 20px;
156
- width: 31px;
157
- height: 31px;
158
-
159
- color: #333;
160
- font-size: 25pt;
161
- line-height: 1em;
162
- text-align: center;
163
- background: white;
164
- -webkit-border-radius: 16px;
165
- border-radius: 16px;
166
- cursor: pointer;
167
-
168
- z-index: 8;
169
- }