motion-prime 0.9.6 → 0.9.7
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 +8 -8
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +6 -6
- data/README.md +1 -10
- data/Rakefile +0 -1
- data/app/app_delegate.rb +1 -1
- data/bin/prime +1 -1
- data/files/Gemfile +1 -1
- data/motion-prime/api_client.rb +87 -31
- data/motion-prime/config/base.rb +20 -11
- data/motion-prime/config/config.rb +9 -3
- data/motion-prime/core_ext/kernel.rb +2 -1
- data/motion-prime/core_ext/nil_class.rb +5 -0
- data/motion-prime/delegate/app_delegate.rb +5 -0
- data/motion-prime/elements/base_element.rb +21 -2
- data/motion-prime/elements/draw.rb +6 -16
- data/motion-prime/helpers/has_authorization.rb +1 -1
- data/motion-prime/models/_base_mixin.rb +1 -1
- data/motion-prime/prime.rb +4 -0
- data/motion-prime/screens/extensions/_indicators_mixin.rb +16 -10
- data/motion-prime/screens/screen.rb +1 -1
- data/motion-prime/sections/_async_table_mixin.rb +1 -2
- data/motion-prime/sections/_draw_section_mixin.rb +3 -1
- data/motion-prime/sections/base_section.rb +37 -26
- data/motion-prime/sections/form.rb +23 -8
- data/motion-prime/sections/form/base_field_section.rb +1 -15
- data/motion-prime/sections/form/date_field_section.rb +1 -1
- data/motion-prime/sections/form/password_field_section.rb +1 -1
- data/motion-prime/sections/form/select_field_section.rb +1 -1
- data/motion-prime/sections/form/string_field_section.rb +1 -1
- data/motion-prime/sections/form/submit_field_section.rb +1 -1
- data/motion-prime/sections/form/text_field_section.rb +1 -1
- data/motion-prime/sections/table.rb +58 -27
- data/motion-prime/sections/table/refresh_mixin.rb +1 -1
- data/motion-prime/services/logger.rb +60 -21
- data/motion-prime/support/consts.rb +11 -0
- data/motion-prime/version.rb +1 -1
- data/motion-prime/views/layout.rb +5 -4
- data/motion-prime/views/view_styler.rb +3 -0
- data/spec/{helpers → factories}/delegates.rb +0 -3
- data/spec/{helpers → factories}/init.rb +0 -0
- data/spec/{helpers → factories}/models.rb +0 -0
- data/spec/factories/scaffold/models/task.rb +4 -0
- data/spec/factories/scaffold/screens/tasks.rb +45 -0
- data/spec/factories/scaffold/sections/tasks/form.rb +31 -0
- data/spec/factories/scaffold/sections/tasks/index_cell.rb +4 -0
- data/spec/factories/scaffold/sections/tasks/index_table.rb +12 -0
- data/spec/factories/scaffold/sections/tasks/show.rb +3 -0
- data/spec/factories/scaffold/styles/tasks.rb +18 -0
- data/spec/{helpers → factories}/screens.rb +0 -0
- data/spec/factories/sections.rb +9 -0
- data/spec/features/scaffold/index.rb +14 -0
- data/spec/features/screens/open_screen.rb +14 -2
- data/spec/helpers/has_content.rb +25 -0
- data/spec/unit/models/dirty_spec.rb +0 -1
- data/spec/unit/models/model_spec.rb +2 -0
- data/spec/unit/prime/logger.rb +49 -0
- data/spec/unit/sections/section_spec.rb +59 -0
- data/travis.sh +1 -1
- metadata +36 -41
- data/doc/FAQ.md +0 -2
- data/doc/SECTION.md +0 -7
- data/doc/STYLE.md +0 -39
- data/doc/code/getting_started.rb +0 -106
- data/doc/code/models.rb +0 -36
- data/doc/code/screens.rb +0 -93
- data/doc/code/sections.rb +0 -65
- data/doc/code/tables.rb +0 -54
- data/doc/docs/docco.css +0 -337
- data/doc/docs/getting_started.html +0 -195
- data/doc/docs/index.html +0 -205
- data/doc/docs/models.html +0 -115
- data/doc/docs/public/fonts/aller-bold.eot +0 -0
- data/doc/docs/public/fonts/aller-bold.ttf +0 -0
- data/doc/docs/public/fonts/aller-bold.woff +0 -0
- data/doc/docs/public/fonts/aller-light.eot +0 -0
- data/doc/docs/public/fonts/aller-light.ttf +0 -0
- data/doc/docs/public/fonts/aller-light.woff +0 -0
- data/doc/docs/public/fonts/fleurons.eot +0 -0
- data/doc/docs/public/fonts/fleurons.ttf +0 -0
- data/doc/docs/public/fonts/fleurons.woff +0 -0
- data/doc/docs/public/fonts/novecento-bold.eot +0 -0
- data/doc/docs/public/fonts/novecento-bold.ttf +0 -0
- data/doc/docs/public/fonts/novecento-bold.woff +0 -0
- data/doc/docs/public/images/gray.png +0 -0
- data/doc/docs/public/stylesheets/normalize.css +0 -375
- data/doc/docs/screens.html +0 -187
- data/doc/docs/sections.html +0 -138
- data/doc/docs/tables.html +0 -128
- data/spec/helpers/sections.rb +0 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmEyMGMyMWQ4OTEwOGI2N2Y5YzZjYmI3MWRmY2Y4MzYzMGNiYjU2MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzI4NzhiNWJiYjJmY2EyMmFiM2M0MjE4MzVmMWM5OWMxNzNjYTdlMQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTlkZGM4MTg1YTI1NjVjOWU0M2U4MzYzNzQ5NzlhZWY5OWVkNjFjMTNkODY2
|
10
|
+
NDAwZjNiMTRlZmJlZDFjMzExODZlOTVhM2YxZmFiMzgwNWVmY2JhOWI1MTI4
|
11
|
+
ZGQ3MTYxOGI4NTAzNmVlMzQ0NDIyNTIxNDdiNmI0NWE4ZDMyMzM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTNlNWRkMDhkNTJiZWU1NTQ2NDA2ODAzMzRhYmQzMzEwODEyYzQ1NjFmOGM5
|
14
|
+
YWZjNWM0ZmY5ZTAyNTQyOGFjYTAzNjY0YzU2YjE1NjgzMWY2ZDhmZjdjMDY2
|
15
|
+
YWYyNDViYTQ2NzJjNzFmMDI3ZGM3ZTBkMDA4MjczYmE4N2YzYjE=
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 0.9.7
|
2
|
+
* BREAKING CHANGE: screen#set_options renamed to screen#set_options_for.
|
3
|
+
* BREAKING CHANGE: section#reload_section renamed to section#hard_reload_section. in common cases use section#reload.
|
4
|
+
* BREAKING CHANGE: form#reload_cell_section renamed to form#hard_reload_cell_section. in common cases use form#reload_cell_sections.
|
5
|
+
* BREAKING CHANGE: table#reset_data renamed to table#reset_table_data
|
6
|
+
|
1
7
|
=== 0.9.6
|
2
8
|
* BREAKING CHANGE: proc for form field option will be executed in context of form, not field.
|
3
9
|
* BREAKING CHANGE: screen#setup renamed to screen#set_options.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
motion-prime (0.9.
|
4
|
+
motion-prime (0.9.7)
|
5
5
|
activesupport
|
6
6
|
afmotion (~> 2.1.0)
|
7
7
|
bubble-wrap (~> 1.5.0)
|
@@ -20,9 +20,9 @@ GEM
|
|
20
20
|
activesupport (3.2.17)
|
21
21
|
i18n (~> 0.6, >= 0.6.4)
|
22
22
|
multi_json (~> 1.0)
|
23
|
-
afmotion (2.1.
|
23
|
+
afmotion (2.1.2)
|
24
24
|
motion-cocoapods (~> 1.4.0)
|
25
|
-
motion-require (
|
25
|
+
motion-require (>= 0.1)
|
26
26
|
bubble-wrap (1.5.0)
|
27
27
|
claide (0.4.0)
|
28
28
|
cocoapods (0.29.0)
|
@@ -54,7 +54,7 @@ GEM
|
|
54
54
|
motion-cocoapods (1.4.0)
|
55
55
|
cocoapods (>= 0.26.2)
|
56
56
|
motion-redgreen (0.1.0)
|
57
|
-
motion-require (0.0
|
57
|
+
motion-require (0.2.0)
|
58
58
|
motion-stump (0.3.1)
|
59
59
|
motion-support (0.2.6)
|
60
60
|
motion-require (>= 0.0.6)
|
@@ -63,8 +63,8 @@ GEM
|
|
63
63
|
open4 (1.3.3)
|
64
64
|
rake (10.1.1)
|
65
65
|
rm-digest (0.0.2)
|
66
|
-
sugarcube (1.5.
|
67
|
-
thor (0.
|
66
|
+
sugarcube (1.5.5)
|
67
|
+
thor (0.19.1)
|
68
68
|
xcodeproj (0.14.1)
|
69
69
|
activesupport (~> 3.0)
|
70
70
|
colored (~> 1.2)
|
data/README.md
CHANGED
@@ -70,6 +70,7 @@ MotionPrime is yet another framework written on RubyMotion for creating really f
|
|
70
70
|
## Samples
|
71
71
|
|
72
72
|
* [Simple to-do app](https://github.com/motionprime/prime_sample_todo)
|
73
|
+
* [Send mail with attached file](https://github.com/cactis/email_attachment_example)
|
73
74
|
|
74
75
|
## Documentation
|
75
76
|
|
@@ -84,16 +85,6 @@ MotionPrime is yet another framework written on RubyMotion for creating really f
|
|
84
85
|
4. Push to the branch (`git push origin my-new-feature`)
|
85
86
|
5. Create new Pull Request
|
86
87
|
|
87
|
-
## Help us with documentation
|
88
|
-
|
89
|
-
We are using [Docco](http://jashkenas.github.io/docco/) to generate documentation.
|
90
|
-
|
91
|
-
Please install the tool and run this to update documentation:
|
92
|
-
|
93
|
-
```
|
94
|
-
$ cd doc && docco code/*.rb --layout linear
|
95
|
-
```
|
96
|
-
|
97
88
|
## Thanks for using MotionPrime!
|
98
89
|
|
99
90
|
Hope, you'll enjoy MotionPrime!
|
data/Rakefile
CHANGED
data/app/app_delegate.rb
CHANGED
data/bin/prime
CHANGED
@@ -47,7 +47,7 @@ class App
|
|
47
47
|
clone_template(template_name, repo)
|
48
48
|
sh "motion create #{name} --template=#{template_name}"
|
49
49
|
end
|
50
|
-
info "Command: bundle
|
50
|
+
info "Command: bundle install"
|
51
51
|
sh "cd ./#{name}; bundle install"
|
52
52
|
info "Command: pod setup"
|
53
53
|
sh "cd ./#{name}; pod setup"
|
data/files/Gemfile
CHANGED
data/motion-prime/api_client.rb
CHANGED
@@ -17,7 +17,7 @@ class ApiClient
|
|
17
17
|
end
|
18
18
|
if config.sign_request?
|
19
19
|
signature = RmDigest::MD5.hexdigest(
|
20
|
-
config.signature_secret +
|
20
|
+
config.signature_secret + params.keys.map(&:to_s).sort.join
|
21
21
|
)
|
22
22
|
params.merge!(sign: signature)
|
23
23
|
end
|
@@ -53,45 +53,60 @@ class ApiClient
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def request(method, path, params = {}, options = {}, &block)
|
56
|
-
params.
|
57
|
-
data = request_params(params)
|
58
|
-
files = data.delete(:_files)
|
59
|
-
use_callback = block_given?
|
56
|
+
files = params.delete(:_files)
|
57
|
+
data = request_params(params.merge(access_token: access_token))
|
60
58
|
|
61
|
-
|
59
|
+
if !options.has_key?(:allow_queue) && config.default_methods_queue.include?(method.to_sym)
|
60
|
+
options[:allow_queue] = true
|
61
|
+
end
|
62
|
+
|
63
|
+
if !options.has_key?(:allow_cache) && config.default_methods_cache.include?(method.to_sym)
|
64
|
+
options[:allow_cache] = true
|
65
|
+
end
|
66
|
+
|
67
|
+
if allow_cache?(method, path, options)
|
68
|
+
cached_request!(method, path, data, files, options, &block)
|
69
|
+
else
|
70
|
+
request!(method, path, data, files, options, &block)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def request!(method, path, data, files = nil, options = {}, &block)
|
75
|
+
use_callback = block_given?
|
62
76
|
path = "#{config.api_namespace}#{path}" unless path.starts_with?('http')
|
77
|
+
client_method = files.present? ? :"multipart_#{method}" : method
|
63
78
|
AFMotion::Client.shared.send client_method, path, data do |response, form_data, progress|
|
64
79
|
if form_data && files.present?
|
65
|
-
files
|
66
|
-
form_data.appendPartWithFileData(file_data[:data], name: file_data[:name], fileName:"avatar.png", mimeType: "image/jpeg")
|
67
|
-
end
|
80
|
+
append_files_to_data(files, form_data)
|
68
81
|
elsif progress
|
69
82
|
# handle progress
|
70
|
-
elsif !response.success? &&
|
71
|
-
|
83
|
+
elsif !response.success? && allow_queue?(method, path, options)
|
84
|
+
queue(method: method, path: path, params: params)
|
72
85
|
elsif response.operation.response.nil?
|
73
86
|
block.call if use_callback
|
74
87
|
else
|
75
|
-
|
76
|
-
|
88
|
+
prepared_response = prepare_response_object(response.object)
|
89
|
+
block.call(prepared_response, response.operation.response.statusCode) if use_callback
|
90
|
+
process_queue if config.allow_queue?
|
77
91
|
end
|
78
92
|
end
|
79
93
|
end
|
80
94
|
|
81
|
-
def
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
95
|
+
def cached_request!(method, path, data, files = nil, options = {}, &block)
|
96
|
+
use_callback = block_given?
|
97
|
+
params = data.map { |key, value| "#{key}=#{value}" }.join('&')
|
98
|
+
cache_key = [method, path, params].join(' ')
|
99
|
+
response = read_cache(cache_key)
|
100
|
+
if response && use_callback
|
101
|
+
block.call(prepare_response_object(response), 200)
|
102
|
+
else
|
103
|
+
request!(method, path, data, files, options) do |response, status|
|
104
|
+
write_cache(cache_key, response)
|
105
|
+
block.call(response, status) if use_callback
|
106
|
+
end
|
86
107
|
end
|
87
108
|
end
|
88
109
|
|
89
|
-
def add_to_queue(item)
|
90
|
-
queue = user_defaults['api_client_queue'].clone || []
|
91
|
-
queue.push(item)
|
92
|
-
user_defaults['api_client_queue'] = queue
|
93
|
-
end
|
94
|
-
|
95
110
|
def get(path, params = {}, options = {}, &block)
|
96
111
|
request(:get, path, params, options, &block)
|
97
112
|
end
|
@@ -101,18 +116,47 @@ class ApiClient
|
|
101
116
|
end
|
102
117
|
|
103
118
|
def post(path, params = {}, options = {}, &block)
|
104
|
-
options[:allow_queue] = true unless options.has_key?(:allow_queue)
|
105
119
|
request(:post, path, params, options, &block)
|
106
120
|
end
|
107
121
|
|
108
122
|
def delete(path, params = {}, options = {}, &block)
|
109
|
-
options[:allow_queue] = true unless options.has_key?(:allow_queue)
|
110
123
|
request(:delete, path, params, options, &block)
|
111
124
|
end
|
112
125
|
|
113
|
-
|
114
|
-
|
115
|
-
|
126
|
+
def queue(item)
|
127
|
+
queue_list = user_defaults['api_client_queue'].clone || []
|
128
|
+
queue_list.push(item)
|
129
|
+
user_defaults['api_client_queue'] = queue_list
|
130
|
+
end
|
131
|
+
|
132
|
+
# TODO: temporary solution, add real caching system here
|
133
|
+
def read_cache(key)
|
134
|
+
puts "read cache #{key}"
|
135
|
+
@cache ||= {}
|
136
|
+
@cache[key]
|
137
|
+
end
|
138
|
+
|
139
|
+
# TODO: temporary solution, add real caching system here
|
140
|
+
def write_cache(key, data)
|
141
|
+
@cache ||= {}
|
142
|
+
@cache[key] = data
|
143
|
+
end
|
144
|
+
|
145
|
+
protected
|
146
|
+
def allow_queue?(method, path, options)
|
147
|
+
options[:allow_queue] && config.allow_queue?
|
148
|
+
end
|
149
|
+
|
150
|
+
def allow_cache?(method, path, options)
|
151
|
+
options[:allow_cache] && config.allow_cache?
|
152
|
+
end
|
153
|
+
|
154
|
+
def process_queue
|
155
|
+
queue_list = user_defaults['api_client_queue']
|
156
|
+
user_defaults['api_client_queue'] = []
|
157
|
+
Array.wrap(queue_list).each do |item|
|
158
|
+
request(item[:method], item[:path], item[:params].clone.symbolize_keys)
|
159
|
+
end
|
116
160
|
end
|
117
161
|
|
118
162
|
def config
|
@@ -123,11 +167,23 @@ class ApiClient
|
|
123
167
|
@user_defaults ||= NSUserDefaults.standardUserDefaults
|
124
168
|
end
|
125
169
|
|
126
|
-
def
|
170
|
+
def append_files_to_data(files, data)
|
171
|
+
files.each do |file|
|
172
|
+
name = file[:name]
|
173
|
+
file_name = file[:file_name] || "avatar.png"
|
174
|
+
mime_type = file[:mime_type] || "image/jpeg"
|
175
|
+
data.appendPartWithFileData(
|
176
|
+
file[:data], name: name, fileName: file_name, mimeType: mime_type
|
177
|
+
)
|
178
|
+
end
|
179
|
+
data
|
180
|
+
end
|
181
|
+
|
182
|
+
def prepare_response_object(object)
|
127
183
|
if object.is_a?(Hash)
|
128
184
|
object.with_indifferent_access
|
129
185
|
elsif object.is_a?(Array)
|
130
|
-
object.map(
|
186
|
+
object.map{ |obj| prepare_response_object(obj) }
|
131
187
|
else
|
132
188
|
object
|
133
189
|
end
|
data/motion-prime/config/base.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
motion_require './config.rb'
|
2
2
|
MotionPrime::Config.configure do |config|
|
3
|
+
# MODELS
|
3
4
|
if MotionPrime.env.test?
|
4
5
|
config.model.store_type = :memory
|
5
6
|
else
|
@@ -7,16 +8,6 @@ MotionPrime::Config.configure do |config|
|
|
7
8
|
end
|
8
9
|
config.model.auto_generate_id = true
|
9
10
|
|
10
|
-
config.fonts do |fonts|
|
11
|
-
fonts.base = :system
|
12
|
-
end
|
13
|
-
|
14
|
-
config.colors do |colors|
|
15
|
-
colors.navigation_base = 0x1b75bc
|
16
|
-
colors.base = 0x1b75bc
|
17
|
-
colors.dark = 0x333333
|
18
|
-
colors.error = 0xef471f
|
19
|
-
end
|
20
11
|
config.api_client do |api|
|
21
12
|
api.base = "http://example.com"
|
22
13
|
api.client_id = ""
|
@@ -26,8 +17,26 @@ MotionPrime::Config.configure do |config|
|
|
26
17
|
api.auth_path = '/oauth/token'
|
27
18
|
api.api_namespace = '/api'
|
28
19
|
api.allow_queue = false
|
20
|
+
api.allow_cache = false
|
21
|
+
api.default_methods_queue = [:post, :delete]
|
22
|
+
api.default_methods_cache = [:get]
|
29
23
|
end
|
24
|
+
|
25
|
+
# APPEARANCE
|
26
|
+
config.fonts do |fonts|
|
27
|
+
fonts.base = :system
|
28
|
+
end
|
29
|
+
config.colors do |colors|
|
30
|
+
colors.navigation_base = 0x1b75bc
|
31
|
+
colors.base = 0x1b75bc
|
32
|
+
colors.dark = 0x333333
|
33
|
+
colors.error = 0xef471f
|
34
|
+
end
|
35
|
+
|
36
|
+
# SECTIONS
|
30
37
|
config.prime.cell_section.mixins = [Prime::CellSectionMixin]
|
31
|
-
|
38
|
+
|
39
|
+
# LOGGER
|
32
40
|
config.logger.dealloc_items = ['screen']
|
41
|
+
config.logger.level = :info
|
33
42
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module MotionPrime
|
2
2
|
class Config
|
3
|
+
attr_accessor :attributes
|
4
|
+
|
3
5
|
def initialize(attributes = {})
|
4
6
|
@attributes = attributes || {}
|
5
7
|
end
|
@@ -13,8 +15,8 @@ module MotionPrime
|
|
13
15
|
end
|
14
16
|
alias :[]= :store
|
15
17
|
|
16
|
-
def fetch(key)
|
17
|
-
@attributes[key.to_sym]
|
18
|
+
def fetch(key, default = nil)
|
19
|
+
@attributes[key.to_sym] || default
|
18
20
|
end
|
19
21
|
|
20
22
|
def nil?
|
@@ -31,7 +33,11 @@ module MotionPrime
|
|
31
33
|
end
|
32
34
|
|
33
35
|
def to_hash
|
34
|
-
|
36
|
+
hash = {}
|
37
|
+
@attributes.each do |key, value|
|
38
|
+
hash[key] = value.is_a?(MotionPrime::Config) ? value.to_hash : value
|
39
|
+
end
|
40
|
+
hash
|
35
41
|
end
|
36
42
|
|
37
43
|
class << self
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class Kernel
|
2
2
|
def pp(*attrs)
|
3
3
|
NSLog([*attrs].map(&:inspect).join(' '))
|
4
|
+
attrs
|
4
5
|
end
|
5
6
|
|
6
7
|
def class_name_without_kvo
|
@@ -39,7 +40,7 @@ class Kernel
|
|
39
40
|
return false
|
40
41
|
end
|
41
42
|
key ||= @_strong_references.keys.last
|
42
|
-
@_strong_references.delete
|
43
|
+
@_strong_references.try(:delete, key)
|
43
44
|
key
|
44
45
|
end
|
45
46
|
|
@@ -23,6 +23,11 @@ module MotionPrime
|
|
23
23
|
user_was = @current_user
|
24
24
|
@current_user = nil
|
25
25
|
NSNotificationCenter.defaultCenter.postNotificationName(:on_current_user_reset, object: user_was)
|
26
|
+
api_client.access_token = current_user.try(:access_token)
|
27
|
+
end
|
28
|
+
|
29
|
+
def api_client
|
30
|
+
@api_client ||= ApiClient.new(access_token: current_user.try(:access_token))
|
26
31
|
end
|
27
32
|
end
|
28
33
|
end
|
@@ -92,14 +92,29 @@ module MotionPrime
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def reload!
|
95
|
+
reset_computed_values
|
95
96
|
compute_options!
|
96
97
|
end
|
97
98
|
|
99
|
+
def rerender!
|
100
|
+
render_target = view.try(:superview)
|
101
|
+
view.try(:removeFromSuperview)
|
102
|
+
render(render_target: render_target)
|
103
|
+
section.try(:on_element_render, self)
|
104
|
+
end
|
105
|
+
|
98
106
|
def update_with_options(new_options = {})
|
99
107
|
options.merge!(new_options)
|
100
108
|
reload!
|
101
|
-
|
102
|
-
|
109
|
+
rerender!
|
110
|
+
end
|
111
|
+
|
112
|
+
def update_options(options)
|
113
|
+
ViewStyler.new(view, view.superview.try(:bounds), options).apply
|
114
|
+
end
|
115
|
+
|
116
|
+
def update
|
117
|
+
update_with_options({})
|
103
118
|
end
|
104
119
|
|
105
120
|
def hide
|
@@ -118,6 +133,10 @@ module MotionPrime
|
|
118
133
|
end
|
119
134
|
|
120
135
|
protected
|
136
|
+
def reset_computed_values
|
137
|
+
@content_height = nil
|
138
|
+
@content_width = nil
|
139
|
+
end
|
121
140
|
|
122
141
|
# Compute options sent inside block, e.g.
|
123
142
|
# element :button do
|