ProMotion-menu 1.0.0.beta1 → 1.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/ProMotion-menu.rb +3 -3
- data/lib/ProMotion/menu/version.rb +1 -1
- data/lib/ProMotion/menu/visibility.rb +12 -2
- data/spec/visibility_spec.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 067b30374c578677ba88d3900dbb8c0b0def0b3c
|
4
|
+
data.tar.gz: df2bb44f0b074c7f95b2a86be819f56216c3683d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a768f4c560234d06e745900685093553c404386db5dac413bf861b6d2616e985c58034cf00b24935758660f6ad60925e198eb0320d1524c8e6ac7574bd012df5
|
7
|
+
data.tar.gz: 5e6afba25e5c6ff96af3189fa1e0dc3b0e34d4cfab6077eefebdcfae38570e76307ed1eef9c8ee43992de46d19a0145bd1c76b9dd609844c1d3d00d1ed90a90a
|
data/README.md
CHANGED
@@ -57,6 +57,7 @@ class MenuDrawer < PM::Menu::Drawer
|
|
57
57
|
self.center = MyGreatAppScreen.new(nav_bar: true)
|
58
58
|
self.left = NavigationScreen
|
59
59
|
self.to_show = [:tap_nav_bar, :pan_nav_bar]
|
60
|
+
self.max_left_width = 250
|
60
61
|
end
|
61
62
|
|
62
63
|
end
|
@@ -132,7 +133,10 @@ app_delegate.menu.toggle(:left)
|
|
132
133
|
app_delegate.menu.toggle_left
|
133
134
|
|
134
135
|
# Equivalent to
|
135
|
-
app_delegate.menu.toggleDrawerSide MMDrawerSideLeft, animated: true, completion: ->(c) { true }
|
136
|
+
app_delegate.menu.toggleDrawerSide MMDrawerSideLeft, animated: true, completion: ->(c) { true }
|
137
|
+
|
138
|
+
# You can also adjust the Menu Drawer width
|
139
|
+
app_delegate.menu.max_left_width = 250
|
136
140
|
|
137
141
|
```
|
138
142
|
|
data/lib/ProMotion-menu.rb
CHANGED
@@ -6,11 +6,11 @@ require 'motion-cocoapods'
|
|
6
6
|
require 'ProMotion'
|
7
7
|
|
8
8
|
Motion::Project::App.setup do |app|
|
9
|
-
core_lib = File.join(File.dirname(__FILE__), 'ProMotion')
|
9
|
+
core_lib = File.join(File.dirname(__FILE__), 'ProMotion/menu')
|
10
10
|
insert_point = app.files.find_index { |file| file =~ /^(?:\.\/)?app\// } || 0
|
11
11
|
|
12
|
-
Dir.glob(File.join(
|
13
|
-
app.files
|
12
|
+
Dir.glob(File.join(core_lib, '**/*.rb')).reverse.each do |file|
|
13
|
+
app.files.insert(insert_point, file)
|
14
14
|
end
|
15
15
|
|
16
16
|
app.pods do
|
@@ -24,11 +24,21 @@ module ProMotion; module Menu
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def toggle_left(animated=true)
|
27
|
-
toggleDrawerSide MMDrawerSideLeft, animated: animated, completion: default_completion_block
|
27
|
+
toggleDrawerSide MMDrawerSideLeft, animated: animated, completion: default_completion_block
|
28
28
|
end
|
29
29
|
|
30
30
|
def toggle_right(animated=true)
|
31
|
-
toggleDrawerSide MMDrawerSideRight, animated: animated, completion: default_completion_block
|
31
|
+
toggleDrawerSide MMDrawerSideRight, animated: animated, completion: default_completion_block
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.included(base)
|
35
|
+
base.class_eval do
|
36
|
+
alias_method :max_left_width, :maximumLeftDrawerWidth
|
37
|
+
alias_method :max_right_width, :maximumRightDrawerWidth
|
38
|
+
|
39
|
+
alias_method :max_left_width=, :setMaximumLeftDrawerWidth
|
40
|
+
alias_method :max_right_width=, :setMaximumRightDrawerWidth
|
41
|
+
end
|
32
42
|
end
|
33
43
|
|
34
44
|
end
|
data/spec/visibility_spec.rb
CHANGED
@@ -79,4 +79,25 @@ describe ProMotion::Menu::Visibility do
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
describe "#max_left_width" do
|
83
|
+
before do
|
84
|
+
@menu = ProMotion::Menu::Drawer.new @content, left: @left, right: @right
|
85
|
+
end
|
86
|
+
|
87
|
+
it "returns the maximum width for a given drawer" do
|
88
|
+
@menu.max_left_width.should.be.kind_of? Float
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe "#max_left_width=" do
|
93
|
+
before do
|
94
|
+
@menu = ProMotion::Menu::Drawer.new @content, left: @left, right: @right
|
95
|
+
end
|
96
|
+
|
97
|
+
it "sets a maximum drawer width" do
|
98
|
+
@menu.max_left_width = 250
|
99
|
+
@menu.maximumLeftDrawerWidth.should == 250
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
82
103
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ProMotion-menu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brewer
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-10-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: motion-cocoapods
|