motion-kit 0.10.10 → 0.10.11

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: bc88d9d5ae26923a6a1537869a7decb22435fa71
4
- data.tar.gz: 232df310d55a46eb997ddb1c343edf58aa8c193c
3
+ metadata.gz: 8a10411c98102a36da52805858f833ea4e6e3f04
4
+ data.tar.gz: 56f823f65361bd4141c5f9e7a9c4f5bc57511347
5
5
  SHA512:
6
- metadata.gz: 9115565f3d88b37e5ea4f637bf1d67f5641133a12f42504072db87a3306373efbd6231abf018faae85e79889b1519314ef8a7799fa3715afd7d0fd5ed49bbecf
7
- data.tar.gz: bde50f100e9705156cb5ec8897ac683466679a478b1f48202ac97e18a566d3960c64363e1663e95fd27b9eaabc342792f02f35b1c46b413995009f390997a6ab
6
+ metadata.gz: 06e500e3f4a458becc6024937193bf36b4e99fce587138a9017f764cfa8340a562912a511265431b5f3970b018c569fc88abdc902a92e36935b6e832717213ce
7
+ data.tar.gz: 3952471f3d7b3ab7181a8a8373b5954fbd8f73f5475c3eb99d42fc87155a4105202d7b2b19af5da6fb83b12ec02f43d80596e7f59b3d133ea4b7bee56e788cb6
@@ -23,7 +23,7 @@ module MotionKit
23
23
  # Ensure we always have a context in this method; makes it easier to define
24
24
  # constraints in an `add_constraints` method.
25
25
  def constraints(view=nil, &block)
26
- if target
26
+ if has_context?
27
27
  apply(:constraints, view, &block)
28
28
  else
29
29
  context(self.view) do
@@ -21,7 +21,7 @@ module MotionKit
21
21
  class Layout
22
22
 
23
23
  def constraints(view=nil, &block)
24
- if target
24
+ if has_context?
25
25
  apply(:constraints, view, &block)
26
26
  else
27
27
  context(self.view) do
@@ -42,6 +42,14 @@ module MotionKit
42
42
  @layout.nil? || @layout == self
43
43
  end
44
44
 
45
+ def has_context?
46
+ if is_parent_layout?
47
+ !!@context
48
+ else
49
+ parent_layout.has_context?
50
+ end
51
+ end
52
+
45
53
  def target
46
54
  if is_parent_layout?
47
55
  # only the "root layout" instance is allowed to change the context.
@@ -1,3 +1,3 @@
1
1
  module MotionKit
2
- VERSION = '0.10.10'
2
+ VERSION = '0.10.11'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.10
4
+ version: 0.10.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin T.A. Gray