oops, calendar header tags might be empty

pull/6827/head
Tim Felgentreff 14 years ago
parent ea315ffd95
commit 4ce42927bd
  1. 1
      lib/widget/base.rb
  2. 2
      lib/widget/filters/date.rb

@ -18,6 +18,7 @@ class Widget::Base < Widget
# Write a string to the canvas. The string is marked as html_safe. # Write a string to the canvas. The string is marked as html_safe.
# This will write twice, if @cache_output is set. # This will write twice, if @cache_output is set.
def write(str) def write(str)
str ||= ""
@output ||= "".html_safe @output ||= "".html_safe
@output.write str.html_safe @output.write str.html_safe
@cache_output.write(str.html_safe) if @cache_output @cache_output.write(str.html_safe) if @cache_output

@ -1,6 +1,6 @@
class Widget::Filters::Date < Widget::Filters::Base class Widget::Filters::Date < Widget::Filters::Base
def calendar_for(field_id) def calendar_for(field_id)
include_calendar_headers_tags + write include_calendar_headers_tags
image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) + image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) +
javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });") javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });")
end end

Loading…
Cancel
Save