4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/ujsos/dom_updater.rb', line 4
def attributes_for_dom_update(remote_options)
return {} if remote_options.blank?
html_options = {}
if (if_option = remote_options[:remote_if])
html_options['data-ujsos-if'] = if_option
else
html_options['data-remote'] = 'true'
end
dom_id = remote_options.delete(:update)
if remote_options.is_a?(Hash) dom_id ||= remote_options[:update]
html_options["data-ujsos-update-position"] = remote_options[:position] if remote_options[:position]
end
html_options["data-ujsos-update"] = dom_id if dom_id
dom_id = remote_options.delete(:replace)
html_options["data-ujsos-replace"] = dom_id if dom_id
if remote_options.is_a?(Hash) && (f =remote_options[:format])
html_options["data-ujsos-format"] = f
end
html_options
end
|