motion-kit 0.10.10 → 0.10.11
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8a10411c98102a36da52805858f833ea4e6e3f04
|
|
4
|
+
data.tar.gz: 56f823f65361bd4141c5f9e7a9c4f5bc57511347
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
26
|
+
if has_context?
|
|
27
27
|
apply(:constraints, view, &block)
|
|
28
28
|
else
|
|
29
29
|
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.
|
data/lib/motion-kit/version.rb
CHANGED