volt 0.5.16 → 0.5.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/volt/page/bindings/component_binding.rb +4 -1
- data/lib/volt/page/bindings/template_binding.rb +13 -12
- data/lib/volt/page/page.rb +3 -0
- data/templates/newgem/app/newgem/config/dependencies.rb +1 -0
- data/templates/newgem/app/newgem/config/routes.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e4f5423f3b9a84c1bfe34c738d04edcc9c64356
|
4
|
+
data.tar.gz: 7098aa69961bc0ab0753e44bb1538a4250824bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36724949a70fdc32f0dfded8516eeccac29c5a487de5a128bc3aca8fce8d88cba8b6ab8444d894645c652e589cbb750147b3e63437c09bc973ebddec9cc526a3
|
7
|
+
data.tar.gz: c9cd8217aaabd2cf2c518e28a0e42f3e4d622c9cbf3f0a5975b8a3a4ed8a638976346b2cb7209f4f816ec2feed8c03d94bac78744cb183f0b7b9d74fb5c83407
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.17
|
@@ -19,11 +19,14 @@ class ComponentBinding < TemplateBinding
|
|
19
19
|
args << SubContext.new(model_with_parent) if @model
|
20
20
|
|
21
21
|
current_context = controller.new(*args)
|
22
|
+
@controller = current_context
|
22
23
|
else
|
23
24
|
# There is not a controller
|
24
25
|
current_context = SubContext.new(model_with_parent, $page)
|
25
26
|
end
|
26
27
|
|
27
|
-
@current_template = TemplateRenderer.new(@target, current_context, @binding_name, full_path)
|
28
|
+
@current_template = TemplateRenderer.new(@target, current_context, @binding_name, full_path)
|
29
|
+
|
30
|
+
call_ready
|
28
31
|
end
|
29
32
|
end
|
@@ -108,7 +108,6 @@ class TemplateBinding < BaseBinding
|
|
108
108
|
|
109
109
|
def update
|
110
110
|
full_path, controller_name = path_for_template(@path.cur, @section.cur)
|
111
|
-
puts "Update: #{full_path} - #{controller_name.inspect}"
|
112
111
|
|
113
112
|
@current_template.remove if @current_template
|
114
113
|
|
@@ -129,13 +128,14 @@ class TemplateBinding < BaseBinding
|
|
129
128
|
# TODO: at the moment a :body section and a :title will both initialize different
|
130
129
|
# controllers. Maybe we should have a way to tie them together?
|
131
130
|
|
132
|
-
|
133
|
-
if
|
131
|
+
controller_class = get_controller(controller_name)
|
132
|
+
if controller_class
|
134
133
|
args = []
|
135
134
|
args << SubContext.new(@model) if @model
|
136
135
|
|
137
136
|
# Setup the controller
|
138
137
|
current_context = controller.new(*args)
|
138
|
+
@controller = current_context
|
139
139
|
else
|
140
140
|
# Pass the context directly
|
141
141
|
current_context = @context
|
@@ -143,18 +143,19 @@ class TemplateBinding < BaseBinding
|
|
143
143
|
|
144
144
|
@current_template = TemplateRenderer.new(@target, current_context, @binding_name, full_path)
|
145
145
|
|
146
|
-
|
147
|
-
|
148
|
-
|
146
|
+
call_ready
|
147
|
+
end
|
148
|
+
|
149
|
+
def call_ready
|
150
|
+
if @controller
|
151
|
+
if @controller.respond_to?(:section=)
|
152
|
+
@controller.section = @current_template.section
|
149
153
|
end
|
150
154
|
|
151
|
-
if
|
152
|
-
|
155
|
+
if @controller.respond_to?(:dom_ready)
|
156
|
+
@controller.dom_ready
|
153
157
|
end
|
154
|
-
|
155
|
-
@controller = controller
|
156
|
-
end
|
157
|
-
|
158
|
+
end
|
158
159
|
end
|
159
160
|
|
160
161
|
def remove
|
data/lib/volt/page/page.rb
CHANGED
@@ -150,6 +150,9 @@ class Page
|
|
150
150
|
`document.title = title;`
|
151
151
|
end
|
152
152
|
TemplateRenderer.new(title_target, main_controller, "main", "home/index/index/title")
|
153
|
+
|
154
|
+
# TODO: this dom ready should really happen in the template renderer
|
155
|
+
main_controller.dom_ready if main_controller.respond_to?(:dom_ready)
|
153
156
|
end
|
154
157
|
|
155
158
|
# When the page is reloaded from the backend, we store the $page.page, so we
|
@@ -0,0 +1 @@
|
|
1
|
+
# Component dependencies
|
@@ -0,0 +1 @@
|
|
1
|
+
# Component routes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stout
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -455,6 +455,8 @@ files:
|
|
455
455
|
- templates/newgem/VERSION
|
456
456
|
- templates/newgem/app/newgem/assets/css/.empty_directory
|
457
457
|
- templates/newgem/app/newgem/assets/js/.empty_directory
|
458
|
+
- templates/newgem/app/newgem/config/dependencies.rb
|
459
|
+
- templates/newgem/app/newgem/config/routes.rb
|
458
460
|
- templates/newgem/app/newgem/controllers/index_controller.rb.tt
|
459
461
|
- templates/newgem/app/newgem/views/index/index.html
|
460
462
|
- templates/newgem/bin/newgem.tt
|