diff options
-rw-r--r-- | web/lib/ui/compare.rb | 1 | ||||
-rw-r--r-- | web/views/compare.erb | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/web/lib/ui/compare.rb b/web/lib/ui/compare.rb index 4c08741..f2c578f 100644 --- a/web/lib/ui/compare.rb +++ b/web/lib/ui/compare.rb @@ -66,6 +66,7 @@ class Taginfo < Sinatra::Base @img_width = TaginfoConfig.get('geodistribution.width') @img_height = TaginfoConfig.get('geodistribution.height') + javascript_for(:cookie) javascript "#{ r18n.locale.code }/compare" erb :compare end diff --git a/web/views/compare.erb b/web/views/compare.erb index e972b3d..dd2e622 100644 --- a/web/views/compare.erb +++ b/web/views/compare.erb @@ -86,6 +86,12 @@ JS.raw(<<"JAVASCRIPT") function page_init2() { var data = #{ @data.to_json }; + jQuery.cookie.json = true; + var items = [] + jQuery.each(data, function(index, item) { + items.push([ item.key, (item.value === null ? undefined : item.value) ]); + }); + set_comparison_list(items); jQuery.each(data, function(index, item) { var datac = []; jQuery.each(data, function(i, item) { |