Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

moved some html around so that the output looks better in the html

  • Loading branch information...
commit de96c2327ac2444cfa039c9ea563799c926e15a7 1 parent 0ab716b
@ejschmitt authored
Showing with 14 additions and 11 deletions.
  1. +14 −11 lib/jsvars.rb
View
25 lib/jsvars.rb
@@ -24,20 +24,23 @@ def include_jsvars
possible_objects = variable.split('.')
possible_objects.each_with_index do |obj, i|
full_obj = possible_objects[0..i].join('.')
- object_tests <<
- "if(#{ full_obj } === undefined) {
- #{ "var" if i == 0 } #{ full_obj } = {};
- }
- "
+ object_tests <<
+"
+if(#{ full_obj } === undefined) {
+ #{ "var" if i == 0 } #{ full_obj } = {};
+}
+"
end
object_tests + "#{ variable } = #{ value.to_json };"
else
- "if (typeof(#{ variable }) === 'object') {
- jsvars.objExtend(#{ variable }, #{ value.to_json });
- }
- else {
- var #{ variable } = #{ value.to_json };
- }"
+"
+if (typeof(#{ variable }) === 'object') {
+ jsvars.objExtend(#{ variable }, #{ value.to_json });
+}
+else {
+ var #{ variable } = #{ value.to_json };
+}
+"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.